Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Angular to v9 #519

Merged
merged 1 commit into from
Apr 28, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,21 @@
})
],
declarations: [ ... ],
providers: [ AngularTokenModule ],
bootstrap: [ ... ]
})
```

3. (Maybe Optional) Fix injection context runtime error
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:
```json
"paths": {
"@angular/*": [ "./node_modules/@angular/*" ]
}
```

## Use

3. Register your user
1. Register your user
```javascript
constructor(private tokenService: AngularTokenService) { }

Expand All @@ -60,7 +68,7 @@
);
```

4. Sign in your user
2. Sign in your user
```javascript
constructor(private tokenService: AngularTokenService) { }

Expand All @@ -73,7 +81,7 @@
);
```

5. Now you can use HttpClient to access private resources
3. Now you can use HttpClient to access private resources
```javascript
constructor(http: HttpClient) { }

Expand Down
12 changes: 9 additions & 3 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,14 @@
"prefix": "app",
"schematics": {
"@schematics/angular:component": {
"styleext": "scss"
"style": "scss"
}
},
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:browser",
"options": {
"aot": true,
"outputPath": "dist/angular-token-app",
"index": "src/index.html",
"main": "src/main.ts",
Expand Down Expand Up @@ -54,6 +55,10 @@
"type": "initial",
"maximumWarning": "2mb",
"maximumError": "5mb"
},
{
"type": "anyComponentStyle",
"maximumWarning": "6kb"
}
]
}
Expand Down Expand Up @@ -150,7 +155,8 @@
},
"configurations": {
"production": {
"project": "projects/angular-token/ng-package.prod.json"
"project": "projects/angular-token/ng-package.prod.json",
"tsConfig": "projects/angular-token/tsconfig.lib.prod.json"
}
}
},
Expand Down Expand Up @@ -178,4 +184,4 @@
}
},
"defaultProject": "angular-token-app"
}
}
File renamed without changes.
Loading