├── .editorconfig
├── .gitignore
├── .vscode
├── extensions.json
├── launch.json
└── tasks.json
├── README.md
├── angular.json
├── db.json
├── package-lock.json
├── package.json
├── src
├── app
│ ├── app-routing.module.ts
│ ├── app.component.css
│ ├── app.component.html
│ ├── app.component.spec.ts
│ ├── app.component.ts
│ ├── app.module.ts
│ ├── customer
│ │ ├── customer.component.css
│ │ ├── customer.component.html
│ │ ├── customer.component.spec.ts
│ │ └── customer.component.ts
│ ├── guard
│ │ ├── auth.guard.spec.ts
│ │ └── auth.guard.ts
│ ├── home
│ │ ├── home.component.css
│ │ ├── home.component.html
│ │ ├── home.component.spec.ts
│ │ └── home.component.ts
│ ├── login
│ │ ├── login.component.css
│ │ ├── login.component.html
│ │ ├── login.component.spec.ts
│ │ └── login.component.ts
│ ├── model
│ │ └── usermodel.ts
│ ├── register
│ │ ├── register.component.css
│ │ ├── register.component.html
│ │ ├── register.component.spec.ts
│ │ └── register.component.ts
│ ├── service
│ │ ├── auth.service.spec.ts
│ │ └── auth.service.ts
│ ├── updatepopup
│ │ ├── updatepopup.component.css
│ │ ├── updatepopup.component.html
│ │ ├── updatepopup.component.spec.ts
│ │ └── updatepopup.component.ts
│ └── user
│ │ ├── user.component.css
│ │ ├── user.component.html
│ │ ├── user.component.spec.ts
│ │ └── user.component.ts
├── assets
│ └── .gitkeep
├── favicon.ico
├── index.html
├── main.ts
├── material.module.ts
└── styles.css
├── tsconfig.app.json
├── tsconfig.json
└── tsconfig.spec.json
/.editorconfig:
--------------------------------------------------------------------------------
1 | # Editor configuration, see https://editorconfig.org
2 | root = true
3 |
4 | [*]
5 | charset = utf-8
6 | indent_style = space
7 | indent_size = 2
8 | insert_final_newline = true
9 | trim_trailing_whitespace = true
10 |
11 | [*.ts]
12 | quote_type = single
13 |
14 | [*.md]
15 | max_line_length = off
16 | trim_trailing_whitespace = false
17 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # See http://help.github.com/ignore-files/ for more about ignoring files.
2 |
3 | # Compiled output
4 | /dist
5 | /tmp
6 | /out-tsc
7 | /bazel-out
8 |
9 | # Node
10 | /node_modules
11 | npm-debug.log
12 | yarn-error.log
13 |
14 | # IDEs and editors
15 | .idea/
16 | .project
17 | .classpath
18 | .c9/
19 | *.launch
20 | .settings/
21 | *.sublime-workspace
22 |
23 | # Visual Studio Code
24 | .vscode/*
25 | !.vscode/settings.json
26 | !.vscode/tasks.json
27 | !.vscode/launch.json
28 | !.vscode/extensions.json
29 | .history/*
30 |
31 | # Miscellaneous
32 | /.angular/cache
33 | .sass-cache/
34 | /connect.lock
35 | /coverage
36 | /libpeerconnection.log
37 | testem.log
38 | /typings
39 |
40 | # System files
41 | .DS_Store
42 | Thumbs.db
43 |
--------------------------------------------------------------------------------
/.vscode/extensions.json:
--------------------------------------------------------------------------------
1 | {
2 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=827846
3 | "recommendations": ["angular.ng-template"]
4 | }
5 |
--------------------------------------------------------------------------------
/.vscode/launch.json:
--------------------------------------------------------------------------------
1 | {
2 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
3 | "version": "0.2.0",
4 | "configurations": [
5 | {
6 | "name": "ng serve",
7 | "type": "pwa-chrome",
8 | "request": "launch",
9 | "preLaunchTask": "npm: start",
10 | "url": "http://localhost:4200/"
11 | },
12 | {
13 | "name": "ng test",
14 | "type": "chrome",
15 | "request": "launch",
16 | "preLaunchTask": "npm: test",
17 | "url": "http://localhost:9876/debug.html"
18 | }
19 | ]
20 | }
21 |
--------------------------------------------------------------------------------
/.vscode/tasks.json:
--------------------------------------------------------------------------------
1 | {
2 | // For more information, visit: https://go.microsoft.com/fwlink/?LinkId=733558
3 | "version": "2.0.0",
4 | "tasks": [
5 | {
6 | "type": "npm",
7 | "script": "start",
8 | "isBackground": true,
9 | "problemMatcher": {
10 | "owner": "typescript",
11 | "pattern": "$tsc",
12 | "background": {
13 | "activeOnStart": true,
14 | "beginsPattern": {
15 | "regexp": "(.*?)"
16 | },
17 | "endsPattern": {
18 | "regexp": "bundle generation complete"
19 | }
20 | }
21 | }
22 | },
23 | {
24 | "type": "npm",
25 | "script": "test",
26 | "isBackground": true,
27 | "problemMatcher": {
28 | "owner": "typescript",
29 | "pattern": "$tsc",
30 | "background": {
31 | "activeOnStart": true,
32 | "beginsPattern": {
33 | "regexp": "(.*?)"
34 | },
35 | "endsPattern": {
36 | "regexp": "bundle generation complete"
37 | }
38 | }
39 | }
40 | }
41 | ]
42 | }
43 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Authentication
2 |
3 | This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 15.0.0.
4 |
5 | ## Development server
6 |
7 | Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The application will automatically reload if you change any of the source files.
8 |
9 | ## Code scaffolding
10 |
11 | Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`.
12 |
13 | ## Build
14 |
15 | Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory.
16 |
17 | ## Running unit tests
18 |
19 | Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io).
20 |
21 | ## Running end-to-end tests
22 |
23 | Run `ng e2e` to execute the end-to-end tests via a platform of your choice. To use this command, you need to first add a package that implements end-to-end testing capabilities.
24 |
25 | ## Further help
26 |
27 | To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI Overview and Command Reference](https://angular.io/cli) page.
28 |
--------------------------------------------------------------------------------
/angular.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "./node_modules/@angular/cli/lib/config/schema.json",
3 | "version": 1,
4 | "newProjectRoot": "projects",
5 | "projects": {
6 | "authentication": {
7 | "projectType": "application",
8 | "schematics": {},
9 | "root": "",
10 | "sourceRoot": "src",
11 | "prefix": "app",
12 | "architect": {
13 | "build": {
14 | "builder": "@angular-devkit/build-angular:browser",
15 | "options": {
16 | "outputPath": "dist/authentication",
17 | "index": "src/index.html",
18 | "main": "src/main.ts",
19 | "polyfills": [
20 | "zone.js"
21 | ],
22 | "tsConfig": "tsconfig.app.json",
23 | "assets": [
24 | "src/favicon.ico",
25 | "src/assets"
26 | ],
27 | "styles": [
28 | "@angular/material/prebuilt-themes/indigo-pink.css",
29 | "src/styles.css",
30 | "node_modules/ngx-toastr/toastr.css"
31 | ],
32 | "scripts": []
33 | },
34 | "configurations": {
35 | "production": {
36 | "budgets": [
37 | {
38 | "type": "initial",
39 | "maximumWarning": "500kb",
40 | "maximumError": "1mb"
41 | },
42 | {
43 | "type": "anyComponentStyle",
44 | "maximumWarning": "2kb",
45 | "maximumError": "4kb"
46 | }
47 | ],
48 | "outputHashing": "all"
49 | },
50 | "development": {
51 | "buildOptimizer": false,
52 | "optimization": false,
53 | "vendorChunk": true,
54 | "extractLicenses": false,
55 | "sourceMap": true,
56 | "namedChunks": true
57 | }
58 | },
59 | "defaultConfiguration": "production"
60 | },
61 | "serve": {
62 | "builder": "@angular-devkit/build-angular:dev-server",
63 | "configurations": {
64 | "production": {
65 | "browserTarget": "authentication:build:production"
66 | },
67 | "development": {
68 | "browserTarget": "authentication:build:development"
69 | }
70 | },
71 | "defaultConfiguration": "development"
72 | },
73 | "extract-i18n": {
74 | "builder": "@angular-devkit/build-angular:extract-i18n",
75 | "options": {
76 | "browserTarget": "authentication:build"
77 | }
78 | },
79 | "test": {
80 | "builder": "@angular-devkit/build-angular:karma",
81 | "options": {
82 | "polyfills": [
83 | "zone.js",
84 | "zone.js/testing"
85 | ],
86 | "tsConfig": "tsconfig.spec.json",
87 | "assets": [
88 | "src/favicon.ico",
89 | "src/assets"
90 | ],
91 | "styles": [
92 | "@angular/material/prebuilt-themes/indigo-pink.css",
93 | "src/styles.css"
94 | ],
95 | "scripts": []
96 | }
97 | }
98 | }
99 | }
100 | }
101 | }
102 |
--------------------------------------------------------------------------------
/db.json:
--------------------------------------------------------------------------------
1 | {
2 | "user": [
3 | {
4 | "id": "admin",
5 | "name": "NT Infotech",
6 | "password": "Test$1234",
7 | "email": "test@gmail.com",
8 | "gender": "male",
9 | "role": "admin",
10 | "isactive": true,
11 | "address":{
12 | "area":"chennai"
13 | }
14 | },
15 | {
16 | "id": "testuser",
17 | "name": "Test User",
18 | "password": "Test@1234",
19 | "email": "test@in.com",
20 | "gender": "male",
21 | "role": "user",
22 | "isactive": true,
23 | "address":{
24 | "area":"chennai"
25 | }
26 | },
27 | {
28 | "id": "Jhon1",
29 | "name": "NT Infotech",
30 | "password": "Test@1233",
31 | "email": "te@in.com",
32 | "gender": "male",
33 | "role": "tech",
34 | "isactive": true,
35 | "address":{
36 | "area":"chennai"
37 | }
38 | },
39 | {
40 | "id": "ntuser",
41 | "name": "ramesh",
42 | "password": "Test@1234",
43 | "email": "te@in.com",
44 | "gender": "male",
45 | "role": "tech",
46 | "isactive": true,
47 | "address":{
48 | "area":"banglore"
49 | }
50 | }
51 | ],
52 | "role": [
53 | {
54 | "code": "user",
55 | "name": "User"
56 | },
57 | {
58 | "code": "tech",
59 | "name": "Technician"
60 | }
61 | ],
62 | "menu": [
63 | {
64 | "code": "user",
65 | "name": "User"
66 | },
67 | {
68 | "code": "customer",
69 | "name": "Customer"
70 | }
71 | ],
72 | "roleaccess": [
73 | {
74 | "role": "admin",
75 | "menu": "user",
76 | "haveedit":true,
77 | "haveadd":true,
78 | "havedelete":true
79 | },
80 | {
81 | "role": "admin",
82 | "menu": "customer",
83 | "haveedit":true,
84 | "haveadd":true,
85 | "havedelete":true
86 | },
87 | {
88 | "role": "user",
89 | "menu": "user",
90 | "haveedit":false,
91 | "haveadd":false,
92 | "havedelete":false
93 | },
94 | {
95 | "role": "user",
96 | "menu": "customer",
97 | "haveedit":true,
98 | "haveadd":true,
99 | "havedelete":false
100 | }
101 |
102 |
103 | ],
104 | "customer":[
105 | {
106 | "id":1,
107 | "name":"rakhesh",
108 | "Creditlimit":1000
109 | },
110 | {
111 | "id":2,
112 | "name":"rahul",
113 | "Creditlimit":1000
114 | },
115 | {
116 | "id":3,
117 | "name":"ramesh",
118 | "Creditlimit":1000
119 | },
120 | {
121 | "id":4,
122 | "name":"rahim",
123 | "Creditlimit":1000
124 | },
125 | {
126 | "id":5,
127 | "name":"robert",
128 | "Creditlimit":1000
129 | }
130 | ]
131 | }
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "authentication",
3 | "version": "0.0.0",
4 | "scripts": {
5 | "ng": "ng",
6 | "start": "ng serve",
7 | "build": "ng build",
8 | "watch": "ng build --watch --configuration development",
9 | "test": "ng test"
10 | },
11 | "private": true,
12 | "dependencies": {
13 | "@angular/animations": "^15.0.0",
14 | "@angular/cdk": "^15.0.4",
15 | "@angular/common": "^15.0.0",
16 | "@angular/compiler": "^15.0.0",
17 | "@angular/core": "^15.0.0",
18 | "@angular/forms": "^15.0.0",
19 | "@angular/material": "^15.0.4",
20 | "@angular/platform-browser": "^15.0.0",
21 | "@angular/platform-browser-dynamic": "^15.0.0",
22 | "@angular/router": "^15.0.0",
23 | "ngx-toastr": "^16.0.2",
24 | "rxjs": "~7.5.0",
25 | "tslib": "^2.3.0",
26 | "zone.js": "~0.12.0"
27 | },
28 | "devDependencies": {
29 | "@angular-devkit/build-angular": "^15.0.0",
30 | "@angular/cli": "~15.0.0",
31 | "@angular/compiler-cli": "^15.0.0",
32 | "@types/jasmine": "~4.3.0",
33 | "jasmine-core": "~4.5.0",
34 | "karma": "~6.4.0",
35 | "karma-chrome-launcher": "~3.1.0",
36 | "karma-coverage": "~2.2.0",
37 | "karma-jasmine": "~5.1.0",
38 | "karma-jasmine-html-reporter": "~2.0.0",
39 | "typescript": "~4.8.2"
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/src/app/app-routing.module.ts:
--------------------------------------------------------------------------------
1 | import { NgModule } from '@angular/core';
2 | import { RouterModule, Routes } from '@angular/router';
3 | import { CustomerComponent } from './customer/customer.component';
4 | import { AuthGuard } from './guard/auth.guard';
5 | import { HomeComponent } from './home/home.component';
6 | import { LoginComponent } from './login/login.component';
7 | import { RegisterComponent } from './register/register.component';
8 | import { UserComponent } from './user/user.component';
9 |
10 | const routes: Routes = [
11 | {component:LoginComponent,path:'login'},
12 | {component:RegisterComponent,path:'register'},
13 | {component:HomeComponent,path:'',canActivate:[AuthGuard]},
14 | {component:UserComponent,path:'user',canActivate:[AuthGuard]},
15 | {component:CustomerComponent,path:'customer',canActivate:[AuthGuard]},
16 | ];
17 |
18 | @NgModule({
19 | imports: [RouterModule.forRoot(routes)],
20 | exports: [RouterModule]
21 | })
22 | export class AppRoutingModule { }
23 |
--------------------------------------------------------------------------------
/src/app/app.component.css:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nihira2020/Angular15authentication/5825304499ff061b335f2f92752737acc4f5cd12/src/app/app.component.css
--------------------------------------------------------------------------------
/src/app/app.component.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
304 |
305 |
306 |
320 |
321 |
322 |
323 |
324 |
325 |
326 |
327 |
328 |
329 |
330 |
331 |
332 |
333 |
334 |
--------------------------------------------------------------------------------
/src/app/app.component.spec.ts:
--------------------------------------------------------------------------------
1 | import { TestBed } from '@angular/core/testing';
2 | import { RouterTestingModule } from '@angular/router/testing';
3 | import { AppComponent } from './app.component';
4 |
5 | describe('AppComponent', () => {
6 | beforeEach(async () => {
7 | await TestBed.configureTestingModule({
8 | imports: [
9 | RouterTestingModule
10 | ],
11 | declarations: [
12 | AppComponent
13 | ],
14 | }).compileComponents();
15 | });
16 |
17 | it('should create the app', () => {
18 | const fixture = TestBed.createComponent(AppComponent);
19 | const app = fixture.componentInstance;
20 | expect(app).toBeTruthy();
21 | });
22 |
23 | it(`should have as title 'authentication'`, () => {
24 | const fixture = TestBed.createComponent(AppComponent);
25 | const app = fixture.componentInstance;
26 | expect(app.title).toEqual('authentication');
27 | });
28 |
29 | it('should render title', () => {
30 | const fixture = TestBed.createComponent(AppComponent);
31 | fixture.detectChanges();
32 | const compiled = fixture.nativeElement as HTMLElement;
33 | expect(compiled.querySelector('.content span')?.textContent).toContain('authentication app is running!');
34 | });
35 | });
36 |
--------------------------------------------------------------------------------
/src/app/app.component.ts:
--------------------------------------------------------------------------------
1 | import { Component,DoCheck } from '@angular/core';
2 | import { ActivatedRoute, Route, Router } from '@angular/router';
3 |
4 | @Component({
5 | selector: 'app-root',
6 | templateUrl: './app.component.html',
7 | styleUrls: ['./app.component.css']
8 | })
9 | export class AppComponent implements DoCheck {
10 | title = 'authentication';
11 | isadmin=false;
12 | isMenuVisible=false;
13 | constructor(private route:Router){
14 | let role=sessionStorage.getItem('role');
15 | if(role=='admin'){
16 | this.isadmin=true;
17 | }
18 | }
19 | ngDoCheck(): void {
20 | let currentroute = this.route.url;
21 | let role=sessionStorage.getItem('role');
22 | if (currentroute == '/login' || currentroute == '/register') {
23 | this.isMenuVisible = false
24 | } else {
25 | this.isMenuVisible = true
26 | }
27 |
28 | if (role == 'admin') {
29 | this.isadmin = true;
30 | }else{
31 | this.isadmin = false;
32 | }
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/src/app/app.module.ts:
--------------------------------------------------------------------------------
1 | import { NgModule } from '@angular/core';
2 | import { BrowserModule } from '@angular/platform-browser';
3 |
4 | import { AppRoutingModule } from './app-routing.module';
5 | import { AppComponent } from './app.component';
6 | import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
7 | import { RegisterComponent } from './register/register.component';
8 | import { LoginComponent } from './login/login.component';
9 | import { HomeComponent } from './home/home.component';
10 | import { UserComponent } from './user/user.component';
11 | import {ReactiveFormsModule} from '@angular/forms';
12 | import {MaterialModule} from 'src/material.module';
13 | import {HttpClientModule} from '@angular/common/http';
14 | import { ToastrModule } from 'ngx-toastr';
15 | import { UpdatepopupComponent } from './updatepopup/updatepopup.component';
16 | import { CustomerComponent } from './customer/customer.component';
17 |
18 | @NgModule({
19 | declarations: [
20 | AppComponent,
21 | RegisterComponent,
22 | LoginComponent,
23 | HomeComponent,
24 | UserComponent,
25 | UpdatepopupComponent,
26 | CustomerComponent
27 | ],
28 | imports: [
29 | BrowserModule,
30 | AppRoutingModule,
31 | BrowserAnimationsModule,
32 | ReactiveFormsModule,
33 | MaterialModule,
34 | HttpClientModule,
35 | ToastrModule.forRoot()
36 | ],
37 | providers: [],
38 | bootstrap: [AppComponent]
39 | })
40 | export class AppModule { }
41 |
--------------------------------------------------------------------------------
/src/app/customer/customer.component.css:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nihira2020/Angular15authentication/5825304499ff061b335f2f92752737acc4f5cd12/src/app/customer/customer.component.css
--------------------------------------------------------------------------------
/src/app/customer/customer.component.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | Customer Listing
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 | Code |
15 | {{element.id}} |
16 |
17 |
18 |
19 |
20 | Name |
21 | {{element.name}} |
22 |
23 |
24 |
25 |
26 | Creditlimit |
27 | {{element.Creditlimit}} |
28 |
29 |
30 |
31 | Action |
32 |
33 |
34 |
35 | |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
--------------------------------------------------------------------------------
/src/app/customer/customer.component.spec.ts:
--------------------------------------------------------------------------------
1 | import { ComponentFixture, TestBed } from '@angular/core/testing';
2 |
3 | import { CustomerComponent } from './customer.component';
4 |
5 | describe('CustomerComponent', () => {
6 | let component: CustomerComponent;
7 | let fixture: ComponentFixture;
8 |
9 | beforeEach(async () => {
10 | await TestBed.configureTestingModule({
11 | declarations: [ CustomerComponent ]
12 | })
13 | .compileComponents();
14 |
15 | fixture = TestBed.createComponent(CustomerComponent);
16 | component = fixture.componentInstance;
17 | fixture.detectChanges();
18 | });
19 |
20 | it('should create', () => {
21 | expect(component).toBeTruthy();
22 | });
23 | });
24 |
--------------------------------------------------------------------------------
/src/app/customer/customer.component.ts:
--------------------------------------------------------------------------------
1 | import { Component, ViewChild } from '@angular/core';
2 | import { MatPaginator } from '@angular/material/paginator';
3 | import { MatSort } from '@angular/material/sort';
4 | import { MatTableDataSource } from '@angular/material/table';
5 | import { Router } from '@angular/router';
6 | import { ToastrService } from 'ngx-toastr';
7 | import { AuthService } from '../service/auth.service';
8 |
9 | @Component({
10 | selector: 'app-customer',
11 | templateUrl: './customer.component.html',
12 | styleUrls: ['./customer.component.css']
13 | })
14 | export class CustomerComponent {
15 |
16 | constructor(private service: AuthService,private toastr:ToastrService,private router: Router) {
17 |
18 | this.SetAccesspermission();
19 |
20 | }
21 | customerlist: any;
22 | dataSource: any;
23 | @ViewChild(MatPaginator) paginator!: MatPaginator;
24 | @ViewChild(MatSort) sort!: MatSort;
25 |
26 | accessdata: any;
27 | haveedit = false;
28 | haveadd = false;
29 | havedelete = false;
30 |
31 | ngAfterViewInit(): void {
32 |
33 | }
34 | LoadCustomer() {
35 | this.service.GetAllCustomer().subscribe(res => {
36 | this.customerlist = res;
37 | this.dataSource = new MatTableDataSource(this.customerlist);
38 | this.dataSource.paginator = this.paginator;
39 | this.dataSource.sort = this.sort;
40 | });
41 | }
42 | SetAccesspermission() {
43 | this.service.Getaccessbyrole(this.service.getrole(), 'customer').subscribe(res => {
44 | this.accessdata = res;
45 | //console.log(this.accessdata);
46 |
47 | if(this.accessdata.length>0){
48 | this.haveadd=this.accessdata[0].haveadd;
49 | this.haveedit=this.accessdata[0].haveedit;
50 | this.havedelete=this.accessdata[0].havedelete;
51 | this.LoadCustomer();
52 | }else{
53 | alert('you are not authorized to access.');
54 | this.router.navigate(['']);
55 | }
56 |
57 | });
58 | }
59 | displayedColumns: string[] = ['code', 'name', 'creditlimit', 'action'];
60 |
61 | updatecustomer(code: any) {
62 |
63 | if(this.haveedit){
64 | this.toastr.success('Success')
65 | }else{
66 | this.toastr.warning("You don't have access for Edit")
67 | }
68 |
69 | }
70 | removecustomer(code: any) {
71 | if(this.havedelete){
72 | this.toastr.success('Success')
73 | }else{
74 | this.toastr.warning("You don't have access for Delete")
75 | }
76 | }
77 | addcustomer() {
78 | if(this.haveadd){
79 | this.toastr.success('Success')
80 | }else{
81 | this.toastr.warning("You don't have access for Create")
82 | }
83 | }
84 |
85 |
86 | }
87 |
--------------------------------------------------------------------------------
/src/app/guard/auth.guard.spec.ts:
--------------------------------------------------------------------------------
1 | import { TestBed } from '@angular/core/testing';
2 |
3 | import { AuthGuard } from './auth.guard';
4 |
5 | describe('AuthGuard', () => {
6 | let guard: AuthGuard;
7 |
8 | beforeEach(() => {
9 | TestBed.configureTestingModule({});
10 | guard = TestBed.inject(AuthGuard);
11 | });
12 |
13 | it('should be created', () => {
14 | expect(guard).toBeTruthy();
15 | });
16 | });
17 |
--------------------------------------------------------------------------------
/src/app/guard/auth.guard.ts:
--------------------------------------------------------------------------------
1 | import { Injectable } from '@angular/core';
2 | import { ActivatedRouteSnapshot, CanActivate, Router, RouterStateSnapshot, UrlTree } from '@angular/router';
3 | import { ToastrService } from 'ngx-toastr';
4 | import { Observable } from 'rxjs';
5 | import { AuthService } from '../service/auth.service';
6 |
7 | @Injectable({
8 | providedIn: 'root'
9 | })
10 | export class AuthGuard implements CanActivate {
11 | constructor(private service: AuthService, private router: Router,private tostr:ToastrService) { }
12 | canActivate(
13 | route: ActivatedRouteSnapshot,
14 | state: RouterStateSnapshot): Observable | Promise | boolean | UrlTree {
15 |
16 | if (this.service.isloggedin()) {
17 | if (route.url.length > 0) {
18 | let menu = route.url[0].path;
19 | if (menu == 'user') {
20 | if (this.service.getrole() == 'admin') {
21 | return true;
22 | } else {
23 | this.router.navigate(['']);
24 | this.tostr.warning('You dont have access.')
25 | return false;
26 | }
27 | }else{
28 | return true;
29 | }
30 | } else {
31 | return true;
32 | }
33 | }
34 | else {
35 | this.router.navigate(['login']);
36 | return false;
37 | }
38 | }
39 |
40 | }
41 |
--------------------------------------------------------------------------------
/src/app/home/home.component.css:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nihira2020/Angular15authentication/5825304499ff061b335f2f92752737acc4f5cd12/src/app/home/home.component.css
--------------------------------------------------------------------------------
/src/app/home/home.component.html:
--------------------------------------------------------------------------------
1 |
2 |
Welcome To Nihira Techiees
3 | Angular 15 Tutorial
4 | Authentication using JSON SERVER
5 |
6 |
--------------------------------------------------------------------------------
/src/app/home/home.component.spec.ts:
--------------------------------------------------------------------------------
1 | import { ComponentFixture, TestBed } from '@angular/core/testing';
2 |
3 | import { HomeComponent } from './home.component';
4 |
5 | describe('HomeComponent', () => {
6 | let component: HomeComponent;
7 | let fixture: ComponentFixture;
8 |
9 | beforeEach(async () => {
10 | await TestBed.configureTestingModule({
11 | declarations: [ HomeComponent ]
12 | })
13 | .compileComponents();
14 |
15 | fixture = TestBed.createComponent(HomeComponent);
16 | component = fixture.componentInstance;
17 | fixture.detectChanges();
18 | });
19 |
20 | it('should create', () => {
21 | expect(component).toBeTruthy();
22 | });
23 | });
24 |
--------------------------------------------------------------------------------
/src/app/home/home.component.ts:
--------------------------------------------------------------------------------
1 | import { Component } from '@angular/core';
2 |
3 | @Component({
4 | selector: 'app-home',
5 | templateUrl: './home.component.html',
6 | styleUrls: ['./home.component.css']
7 | })
8 | export class HomeComponent {
9 |
10 | }
11 |
--------------------------------------------------------------------------------
/src/app/login/login.component.css:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nihira2020/Angular15authentication/5825304499ff061b335f2f92752737acc4f5cd12/src/app/login/login.component.css
--------------------------------------------------------------------------------
/src/app/login/login.component.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | User Login
4 |
5 |
6 |
21 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/src/app/login/login.component.spec.ts:
--------------------------------------------------------------------------------
1 | import { ComponentFixture, TestBed } from '@angular/core/testing';
2 |
3 | import { LoginComponent } from './login.component';
4 |
5 | describe('LoginComponent', () => {
6 | let component: LoginComponent;
7 | let fixture: ComponentFixture;
8 |
9 | beforeEach(async () => {
10 | await TestBed.configureTestingModule({
11 | declarations: [ LoginComponent ]
12 | })
13 | .compileComponents();
14 |
15 | fixture = TestBed.createComponent(LoginComponent);
16 | component = fixture.componentInstance;
17 | fixture.detectChanges();
18 | });
19 |
20 | it('should create', () => {
21 | expect(component).toBeTruthy();
22 | });
23 | });
24 |
--------------------------------------------------------------------------------
/src/app/login/login.component.ts:
--------------------------------------------------------------------------------
1 | import { Component } from '@angular/core';
2 | import { FormBuilder, Validators } from '@angular/forms';
3 | import { Router } from '@angular/router';
4 | import { ToastrService } from 'ngx-toastr'
5 | import { AuthService } from '../service/auth.service';
6 |
7 | @Component({
8 | selector: 'app-login',
9 | templateUrl: './login.component.html',
10 | styleUrls: ['./login.component.css']
11 | })
12 | export class LoginComponent {
13 | constructor(private builder: FormBuilder, private toastr: ToastrService, private service: AuthService,
14 | private router: Router) {
15 | sessionStorage.clear();
16 |
17 | }
18 | result: any;
19 |
20 | loginform = this.builder.group({
21 | id: this.builder.control('', Validators.required),
22 | password: this.builder.control('', Validators.required)
23 | });
24 |
25 | proceedlogin() {
26 | if (this.loginform.valid) {
27 | this.service.GetUserbyCode(this.loginform.value.id).subscribe(item => {
28 | this.result = item;
29 | if (this.result.password === this.loginform.value.password) {
30 | if (this.result.isactive) {
31 | sessionStorage.setItem('username',this.result.id);
32 | sessionStorage.setItem('role',this.result.role);
33 | this.router.navigate(['']);
34 | } else {
35 | this.toastr.error('Please contact Admin', 'InActive User');
36 | }
37 | } else {
38 | this.toastr.error('Invalid credentials');
39 | }
40 | });
41 | } else {
42 | this.toastr.warning('Please enter valid data.')
43 | }
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/src/app/model/usermodel.ts:
--------------------------------------------------------------------------------
1 | export interface usermodel{
2 |
3 | }
--------------------------------------------------------------------------------
/src/app/register/register.component.css:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nihira2020/Angular15authentication/5825304499ff061b335f2f92752737acc4f5cd12/src/app/register/register.component.css
--------------------------------------------------------------------------------
/src/app/register/register.component.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | Registeration
4 |
5 |
6 |
32 |
33 |
34 |
35 |
36 |
--------------------------------------------------------------------------------
/src/app/register/register.component.spec.ts:
--------------------------------------------------------------------------------
1 | import { ComponentFixture, TestBed } from '@angular/core/testing';
2 |
3 | import { RegisterComponent } from './register.component';
4 |
5 | describe('RegisterComponent', () => {
6 | let component: RegisterComponent;
7 | let fixture: ComponentFixture;
8 |
9 | beforeEach(async () => {
10 | await TestBed.configureTestingModule({
11 | declarations: [ RegisterComponent ]
12 | })
13 | .compileComponents();
14 |
15 | fixture = TestBed.createComponent(RegisterComponent);
16 | component = fixture.componentInstance;
17 | fixture.detectChanges();
18 | });
19 |
20 | it('should create', () => {
21 | expect(component).toBeTruthy();
22 | });
23 | });
24 |
--------------------------------------------------------------------------------
/src/app/register/register.component.ts:
--------------------------------------------------------------------------------
1 | import { Component } from '@angular/core';
2 | import { FormBuilder, Validators } from '@angular/forms';
3 | import { Router } from '@angular/router';
4 | import { AuthService } from '../service/auth.service';
5 | import { ToastrService } from 'ngx-toastr'
6 |
7 | @Component({
8 | selector: 'app-register',
9 | templateUrl: './register.component.html',
10 | styleUrls: ['./register.component.css']
11 | })
12 | export class RegisterComponent {
13 |
14 | constructor(private builder: FormBuilder, private service: AuthService, private router: Router,
15 | private toastr: ToastrService) {
16 |
17 | }
18 |
19 | registerform = this.builder.group({
20 | id: this.builder.control('', Validators.compose([Validators.required, Validators.minLength(5)])),
21 | name: this.builder.control('', Validators.required),
22 | password: this.builder.control('', Validators.compose([Validators.required, Validators.pattern('(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[$@$!%*?&])[A-Za-z\d$@$!%*?&].{8,}')])),
23 | email: this.builder.control('', Validators.compose([Validators.required, Validators.email])),
24 | gender: this.builder.control('male'),
25 | role: this.builder.control(''),
26 | isactive: this.builder.control(false)
27 | });
28 | proceedregister() {
29 | if (this.registerform.valid) {
30 | this.service.RegisterUser(this.registerform.value).subscribe(result => {
31 | this.toastr.success('Please contact admin for enable access.','Registered successfully')
32 | this.router.navigate(['login'])
33 | });
34 | } else {
35 | this.toastr.warning('Please enter valid data.')
36 | }
37 | }
38 |
39 | }
40 |
--------------------------------------------------------------------------------
/src/app/service/auth.service.spec.ts:
--------------------------------------------------------------------------------
1 | import { TestBed } from '@angular/core/testing';
2 |
3 | import { AuthService } from './auth.service';
4 |
5 | describe('AuthService', () => {
6 | let service: AuthService;
7 |
8 | beforeEach(() => {
9 | TestBed.configureTestingModule({});
10 | service = TestBed.inject(AuthService);
11 | });
12 |
13 | it('should be created', () => {
14 | expect(service).toBeTruthy();
15 | });
16 | });
17 |
--------------------------------------------------------------------------------
/src/app/service/auth.service.ts:
--------------------------------------------------------------------------------
1 | import { HttpClient } from '@angular/common/http';
2 | import { Injectable } from '@angular/core';
3 |
4 | @Injectable({
5 | providedIn: 'root'
6 | })
7 | export class AuthService {
8 |
9 | constructor(private http:HttpClient) {
10 |
11 | }
12 | apiurl='http://localhost:3000/user';
13 |
14 | RegisterUser(inputdata:any){
15 | return this.http.post(this.apiurl,inputdata)
16 | }
17 | GetUserbyCode(id:any){
18 | return this.http.get(this.apiurl+'/'+id);
19 | }
20 | Getall(){
21 | return this.http.get(this.apiurl);
22 | }
23 | updateuser(id:any,inputdata:any){
24 | return this.http.put(this.apiurl+'/'+id,inputdata);
25 | }
26 | getuserrole(){
27 | return this.http.get('http://localhost:3000/role');
28 | }
29 | isloggedin(){
30 | return sessionStorage.getItem('username')!=null;
31 | }
32 | getrole(){
33 | return sessionStorage.getItem('role')!=null?sessionStorage.getItem('role')?.toString():'';
34 | }
35 | GetAllCustomer(){
36 | return this.http.get('http://localhost:3000/customer');
37 | }
38 | Getaccessbyrole(role:any,menu:any){
39 | return this.http.get('http://localhost:3000/roleaccess?role='+role+'&menu='+menu)
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/src/app/updatepopup/updatepopup.component.css:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nihira2020/Angular15authentication/5825304499ff061b335f2f92752737acc4f5cd12/src/app/updatepopup/updatepopup.component.css
--------------------------------------------------------------------------------
/src/app/updatepopup/updatepopup.component.html:
--------------------------------------------------------------------------------
1 | Update User
2 |
--------------------------------------------------------------------------------
/src/app/updatepopup/updatepopup.component.spec.ts:
--------------------------------------------------------------------------------
1 | import { ComponentFixture, TestBed } from '@angular/core/testing';
2 |
3 | import { UpdatepopupComponent } from './updatepopup.component';
4 |
5 | describe('UpdatepopupComponent', () => {
6 | let component: UpdatepopupComponent;
7 | let fixture: ComponentFixture;
8 |
9 | beforeEach(async () => {
10 | await TestBed.configureTestingModule({
11 | declarations: [ UpdatepopupComponent ]
12 | })
13 | .compileComponents();
14 |
15 | fixture = TestBed.createComponent(UpdatepopupComponent);
16 | component = fixture.componentInstance;
17 | fixture.detectChanges();
18 | });
19 |
20 | it('should create', () => {
21 | expect(component).toBeTruthy();
22 | });
23 | });
24 |
--------------------------------------------------------------------------------
/src/app/updatepopup/updatepopup.component.ts:
--------------------------------------------------------------------------------
1 | import { Component, Inject, OnInit } from '@angular/core';
2 | import { FormBuilder, Validators } from '@angular/forms'
3 | import { ToastrService } from 'ngx-toastr';
4 | import { AuthService } from '../service/auth.service';
5 | import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
6 |
7 | @Component({
8 | selector: 'app-updatepopup',
9 | templateUrl: './updatepopup.component.html',
10 | styleUrls: ['./updatepopup.component.css']
11 | })
12 | export class UpdatepopupComponent implements OnInit {
13 |
14 | constructor(private builder: FormBuilder, private service: AuthService, private toastr: ToastrService,
15 | private dialogref: MatDialogRef, @Inject(MAT_DIALOG_DATA) public data: any) {
16 |
17 | this.service.getuserrole().subscribe(res => {
18 | this.rolelist = res;
19 | });
20 |
21 |
22 |
23 | }
24 | ngOnInit(): void {
25 | if (this.data.usercode != '' && this.data.usercode != null) {
26 | this.loaduserdata(this.data.usercode);
27 | }
28 | }
29 | rolelist: any;
30 | editdata: any;
31 |
32 | registerform = this.builder.group({
33 | id: this.builder.control(''),
34 | name: this.builder.control(''),
35 | password: this.builder.control(''),
36 | email: this.builder.control(''),
37 | gender: this.builder.control('male'),
38 | role: this.builder.control('', Validators.required),
39 | isactive: this.builder.control(false)
40 | });
41 |
42 | loaduserdata(code: any) {
43 | this.service.GetUserbyCode(code).subscribe(res => {
44 | this.editdata = res;
45 | console.log(this.editdata);
46 | this.registerform.setValue({
47 | id: this.editdata.id, name: this.editdata.name,
48 | password: this.editdata.password, email: this.editdata.email, gender: this.editdata.gender,
49 | role: this.editdata.role, isactive: this.editdata.isactive
50 | });
51 | });
52 | }
53 | UpdateUser() {
54 | this.service.updateuser(this.registerform.value.id, this.registerform.value).subscribe(res => {
55 | this.toastr.success('Updated successfully.');
56 | this.dialogref.close();
57 | });
58 | }
59 |
60 | }
61 |
--------------------------------------------------------------------------------
/src/app/user/user.component.css:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nihira2020/Angular15authentication/5825304499ff061b335f2f92752737acc4f5cd12/src/app/user/user.component.css
--------------------------------------------------------------------------------
/src/app/user/user.component.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | User Listing
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 | Username |
12 | {{element.id}} |
13 |
14 |
15 |
16 |
17 | Name |
18 | {{element.name}} |
19 |
20 |
21 |
22 |
23 | Email |
24 | {{element.email}} |
25 |
26 |
27 |
28 |
29 | Status |
30 | {{element.isactive ? 'Active':'In Active'}} |
31 |
32 |
33 | Role |
34 | {{element.role ===''? 'Un Assigned':element.role}} |
35 |
36 |
37 | Action |
38 |
39 |
40 | |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
--------------------------------------------------------------------------------
/src/app/user/user.component.spec.ts:
--------------------------------------------------------------------------------
1 | import { ComponentFixture, TestBed } from '@angular/core/testing';
2 |
3 | import { UserComponent } from './user.component';
4 |
5 | describe('UserComponent', () => {
6 | let component: UserComponent;
7 | let fixture: ComponentFixture;
8 |
9 | beforeEach(async () => {
10 | await TestBed.configureTestingModule({
11 | declarations: [ UserComponent ]
12 | })
13 | .compileComponents();
14 |
15 | fixture = TestBed.createComponent(UserComponent);
16 | component = fixture.componentInstance;
17 | fixture.detectChanges();
18 | });
19 |
20 | it('should create', () => {
21 | expect(component).toBeTruthy();
22 | });
23 | });
24 |
--------------------------------------------------------------------------------
/src/app/user/user.component.ts:
--------------------------------------------------------------------------------
1 | import { AfterViewInit, Component, ViewChild } from '@angular/core';
2 | import { FormBuilder, Validators } from '@angular/forms'
3 | import { MatTableDataSource } from '@angular/material/table';
4 | import { MatPaginator } from '@angular/material/paginator';
5 | import { MatSort } from '@angular/material/sort';
6 | import { AuthService } from '../service/auth.service';
7 | import { MatDialog } from '@angular/material/dialog';
8 | import { UpdatepopupComponent } from '../updatepopup/updatepopup.component'
9 |
10 | @Component({
11 | selector: 'app-user',
12 | templateUrl: './user.component.html',
13 | styleUrls: ['./user.component.css']
14 | })
15 | export class UserComponent implements AfterViewInit {
16 |
17 | constructor(private builder: FormBuilder, private service: AuthService, private dialog: MatDialog) {
18 | this.LoadUser();
19 | }
20 | userlist: any;
21 | dataSource: any;
22 | @ViewChild(MatPaginator) paginator!: MatPaginator;
23 | @ViewChild(MatSort) sort!: MatSort;
24 |
25 | ngAfterViewInit(): void {
26 |
27 | }
28 | LoadUser() {
29 | this.service.Getall().subscribe(res => {
30 | this.userlist = res;
31 | this.dataSource = new MatTableDataSource(this.userlist);
32 | this.dataSource.paginator = this.paginator;
33 | this.dataSource.sort = this.sort;
34 | });
35 | }
36 | displayedColumns: string[] = ['username', 'name', 'email', 'status', 'role', 'action'];
37 |
38 | updateuser(code: any) {
39 | this.OpenDialog('1000ms', '600ms', code);
40 | }
41 |
42 | OpenDialog(enteranimation: any, exitanimation: any, code: string) {
43 | const popup = this.dialog.open(UpdatepopupComponent, {
44 | enterAnimationDuration: enteranimation,
45 | exitAnimationDuration: exitanimation,
46 | width: '30%',
47 | data: {
48 | usercode: code
49 | }
50 | });
51 | popup.afterClosed().subscribe(res => {
52 | this.LoadUser();
53 | });
54 | }
55 |
56 |
57 |
58 | }
59 |
--------------------------------------------------------------------------------
/src/assets/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nihira2020/Angular15authentication/5825304499ff061b335f2f92752737acc4f5cd12/src/assets/.gitkeep
--------------------------------------------------------------------------------
/src/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nihira2020/Angular15authentication/5825304499ff061b335f2f92752737acc4f5cd12/src/favicon.ico
--------------------------------------------------------------------------------
/src/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Authentication
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/src/main.ts:
--------------------------------------------------------------------------------
1 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
2 |
3 | import { AppModule } from './app/app.module';
4 |
5 |
6 | platformBrowserDynamic().bootstrapModule(AppModule)
7 | .catch(err => console.error(err));
8 |
--------------------------------------------------------------------------------
/src/material.module.ts:
--------------------------------------------------------------------------------
1 | import { NgModule } from "@angular/core";
2 | import {MatInputModule} from "@angular/material/input";
3 | import {MatCardModule} from "@angular/material/card";
4 | import {MatRadioModule} from "@angular/material/radio";
5 | import {MatButtonModule} from "@angular/material/button";
6 | import {MatTableModule} from "@angular/material/table"
7 | import {MatPaginatorModule} from "@angular/material/paginator"
8 | import {MatSortModule} from "@angular/material/sort"
9 | import {MatDialogModule} from "@angular/material/dialog"
10 | import {MatSelectModule} from "@angular/material/select"
11 | import {MatCheckboxModule} from "@angular/material/checkbox"
12 |
13 |
14 | @NgModule({
15 | exports: [
16 | MatInputModule,
17 | MatCardModule,
18 | MatRadioModule,
19 | MatButtonModule,
20 | MatTableModule,MatPaginatorModule,
21 | MatSortModule,
22 | MatDialogModule,
23 | MatSelectModule,
24 | MatCheckboxModule
25 | ]
26 | })
27 | export class MaterialModule { }
--------------------------------------------------------------------------------
/src/styles.css:
--------------------------------------------------------------------------------
1 | /* You can add global styles to this file, and also import other style files */
2 |
3 | html, body { height: 100%; }
4 | body { margin: 0; font-family: Roboto, "Helvetica Neue", sans-serif; }
5 | .mdc-button{
6 | margin: 5px !important;
7 | }
8 | .mat-mdc-form-field{
9 | width: 100%;
10 | }
11 | .content{
12 | display: block !important;
13 | }
14 | a{
15 | color: white !important;
16 | padding: 1%;
17 | }
--------------------------------------------------------------------------------
/tsconfig.app.json:
--------------------------------------------------------------------------------
1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */
2 | {
3 | "extends": "./tsconfig.json",
4 | "compilerOptions": {
5 | "outDir": "./out-tsc/app",
6 | "types": []
7 | },
8 | "files": [
9 | "src/main.ts"
10 | ],
11 | "include": [
12 | "src/**/*.d.ts"
13 | ]
14 | }
15 |
--------------------------------------------------------------------------------
/tsconfig.json:
--------------------------------------------------------------------------------
1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */
2 | {
3 | "compileOnSave": false,
4 | "compilerOptions": {
5 | "baseUrl": "./",
6 | "outDir": "./dist/out-tsc",
7 | "forceConsistentCasingInFileNames": true,
8 | "strict": true,
9 | "noImplicitOverride": true,
10 | "noPropertyAccessFromIndexSignature": true,
11 | "noImplicitReturns": true,
12 | "noFallthroughCasesInSwitch": true,
13 | "sourceMap": true,
14 | "declaration": false,
15 | "downlevelIteration": true,
16 | "experimentalDecorators": true,
17 | "moduleResolution": "node",
18 | "importHelpers": true,
19 | "target": "ES2022",
20 | "module": "ES2022",
21 | "useDefineForClassFields": false,
22 | "lib": [
23 | "ES2022",
24 | "dom"
25 | ]
26 | },
27 | "angularCompilerOptions": {
28 | "enableI18nLegacyMessageIdFormat": false,
29 | "strictInjectionParameters": true,
30 | "strictInputAccessModifiers": true,
31 | "strictTemplates": true
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/tsconfig.spec.json:
--------------------------------------------------------------------------------
1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */
2 | {
3 | "extends": "./tsconfig.json",
4 | "compilerOptions": {
5 | "outDir": "./out-tsc/spec",
6 | "types": [
7 | "jasmine"
8 | ]
9 | },
10 | "include": [
11 | "src/**/*.spec.ts",
12 | "src/**/*.d.ts"
13 | ]
14 | }
15 |
--------------------------------------------------------------------------------