17.0.0 • Published 5 months ago

@ngx-security/core v17.0.0

Weekly downloads
13
License
MIT
Repository
github
Last release
5 months ago

ngx-security/core

Installation

npm install --save @ngx-security/core

Setup

Import SecurityCoreModule in app module.

@NgModule({
  imports: [
    BrowserModule,
    SecurityCoreModule.forRoot()
  ],
  bootstrap: [AppComponent]
})
export class AppModule {
}

Usage

import { Component, OnInit } from '@angular/core';
import { Subject, SubjectDetails, SubjectService } from '@ngx-security/core';

class UserDetails extends SubjectDetails {
}

class User extends Subject<UserDetails> {
}

@Component({
  selector: 'app-root',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.scss']
})
export class AppComponent implements OnInit {

    constructor(public user: SubjectService<UserDetails, User>) {
    }

    ngOnInit(): void {
        setTimeout(() => {
            this.user.update({
                principal: 'jsnow',
                authorities: ['ROLE_1', 'ROLE_2', 'ROLE_3'],
                details: {
                    displayName: 'Jon Snow'
                }
            });
        });
    }
}
<h3>{{user.displayName$ | async}}</h3>
<h5>{{user.authorities$ | async | json}}</h5>
17.0.0

5 months ago

16.0.0

5 months ago

15.0.0

1 year ago

14.0.0

2 years ago

13.0.0

2 years ago

12.0.0

3 years ago

12.0.1

3 years ago

11.0.1

3 years ago

11.0.0

3 years ago

10.0.2

4 years ago

10.0.1

4 years ago

10.0.0

4 years ago

9.0.0

4 years ago

8.0.2-snapshot.0

5 years ago

8.0.1

5 years ago

8.0.1-snapshot.0

5 years ago

8.0.0

5 years ago

0.0.1

6 years ago