1.0.18 • Published 9 years ago
ng-interceptor-security v1.0.18
Interceptor Security Angular 4
Como usar
- Instalar
npm install --save ng-interceptor-security- Criar um Service
ng g s redirect-interceptor- Implementar
...
import { InterceptorSecurityService } from 'ng-interceptor-security';
...
export class RedirectInterceptorService extends InterceptorSecurityService {
private authorization = 'Basic 123456-123456';
private urlRedirect401 = '/login';
private headers = {
'Authorization': this.authorization,
'Content-Type': 'application/json'
};
constructor(public router: Router) {
super(router);
}
}- Adicionar a Service como provider no Module
...
import { RedirectInterceptorService } from './redirect-interceptor.service';
...
...
providers: [
{
provide: HTTP_INTERCEPTORS,
useClass: RedirectInterceptorService,
multi: true
}
],
...1.0.18
9 years ago
1.0.17
9 years ago
1.0.16
9 years ago
1.0.15
9 years ago
1.0.14
9 years ago
1.0.13
9 years ago
1.0.12
9 years ago
1.0.11
9 years ago
1.0.10
9 years ago
1.0.9
9 years ago
1.0.8
9 years ago
1.0.7
9 years ago
1.0.6
9 years ago
1.0.5
9 years ago
1.0.4
9 years ago
1.0.3
9 years ago
1.0.2
9 years ago
1.0.1
9 years ago
1.0.0
9 years ago