Skip to content

Commit 0ed0f71

Browse files
committed
Update Angular to v9 (#519)
1 parent 397acd1 commit 0ed0f71

20 files changed

+11587
-6953
lines changed

README.md

+12-4
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,21 @@
4040
})
4141
],
4242
declarations: [ ... ],
43-
providers: [ AngularTokenModule ],
4443
bootstrap: [ ... ]
4544
})
4645
```
46+
47+
3. (Maybe Optional) Fix injection context runtime error
48+
After installing this package, if you get an `Error: inject() must be called from an injection context` when running your app, add the following to your typescript path config in the `tsconfig[.app].json` file:
49+
```json
50+
"paths": {
51+
"@angular/*": [ "./node_modules/@angular/*" ]
52+
}
53+
```
54+
4755
## Use
4856
49-
3. Register your user
57+
1. Register your user
5058
```javascript
5159
constructor(private tokenService: AngularTokenService) { }
5260
@@ -60,7 +68,7 @@
6068
);
6169
```
6270
63-
4. Sign in your user
71+
2. Sign in your user
6472
```javascript
6573
constructor(private tokenService: AngularTokenService) { }
6674
@@ -73,7 +81,7 @@
7381
);
7482
```
7583
76-
5. Now you can use HttpClient to access private resources
84+
3. Now you can use HttpClient to access private resources
7785
```javascript
7886
constructor(http: HttpClient) { }
7987

angular.json

+9-3
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,14 @@
1010
"prefix": "app",
1111
"schematics": {
1212
"@schematics/angular:component": {
13-
"styleext": "scss"
13+
"style": "scss"
1414
}
1515
},
1616
"architect": {
1717
"build": {
1818
"builder": "@angular-devkit/build-angular:browser",
1919
"options": {
20+
"aot": true,
2021
"outputPath": "dist/angular-token-app",
2122
"index": "src/index.html",
2223
"main": "src/main.ts",
@@ -54,6 +55,10 @@
5455
"type": "initial",
5556
"maximumWarning": "2mb",
5657
"maximumError": "5mb"
58+
},
59+
{
60+
"type": "anyComponentStyle",
61+
"maximumWarning": "6kb"
5762
}
5863
]
5964
}
@@ -150,7 +155,8 @@
150155
},
151156
"configurations": {
152157
"production": {
153-
"project": "projects/angular-token/ng-package.prod.json"
158+
"project": "projects/angular-token/ng-package.prod.json",
159+
"tsConfig": "projects/angular-token/tsconfig.lib.prod.json"
154160
}
155161
}
156162
},
@@ -178,4 +184,4 @@
178184
}
179185
},
180186
"defaultProject": "angular-token-app"
181-
}
187+
}

src/browserslist browserslist

File renamed without changes.

0 commit comments

Comments
 (0)