https://github.com/indigosoft/ngx-can-activate-app
Confirmation activation of application before load for Angular 5, 6+
https://github.com/indigosoft/ngx-can-activate-app
Last synced: about 1 month ago
JSON representation
Confirmation activation of application before load for Angular 5, 6+
- Host: GitHub
- URL: https://github.com/indigosoft/ngx-can-activate-app
- Owner: Indigosoft
- License: mit
- Created: 2018-06-29T19:25:38.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2018-07-02T12:57:41.000Z (almost 7 years ago)
- Last Synced: 2024-04-26T03:20:40.546Z (about 1 year ago)
- Language: CSS
- Homepage: https://ngx-can-activate-app-demo.stackblitz.io
- Size: 277 KB
- Stars: 5
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# NgxCanActivateApp
[](https://ngx-can-activate-app-demo.stackblitz.io/)
## 1. Install ngx-can-activate-app
```bash
npm i -s ngx-can-activate-app
```## 2. Create component
It will be displayed until your application has finished activating.
```typescript
import { NgxCanActivateApp } from 'ngx-can-activate-app';@Component({
selector: 'app-confirmation',
template: 'Activate'
})
export class ConfirmationComponent {
constructor(private canActivateApp: NgxCanActivateApp) {}onActivate() { this.canActivateApp.activate(); }
}
```## 3. Declare the component
Add it to declarations.
```typescript
@NgModule({
declarations: [ AppComponent, ConfirmationComponent ],
bootstrap: [ AppComponent ]
})
export class AppModule {}
```## 4. Import NgxCanActivateAppModule
Then add your component to the module's initialization.
```typescript
import { NgxCanActivateAppModule } from 'ngx-can-activate-app';@NgModule({
imports: [
NgxCanActivateAppModule.forRoot({
component: ConfirmationComponent
})
],
declarations: [ AppComponent, ConfirmationComponent ],
bootstrap: [ AppComponent ]
})
export class AppModule {}
```## 5. Specify a selector in index.html
Add the selector of your component to index.html.
```html
```