Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ngx-can-activate-app

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ngx-can-activate-app

Confirming activation of Angular before it's loaded for Angular 5, 6+

  • 0.0.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2
increased by100%
Maintainers
1
Weekly downloads
 
Created
Source

NgxCanActivateApp

Can Activate Angular

1. Install ngx-can-activate-app

npm i -s ngx-can-activate-app

2. Create component

It will be displayed until your application has finished activating.

import { NgxCanActivateApp } from 'ngx-can-activate-app';

@Component({
  selector: 'app-confirmation',
  template: '<button (click)="onActivate()">Activate</button>'
})
export class ConfirmationComponent {
  constructor(private canActivateApp: NgxCanActivateApp) {}

  onActivate() { this.canActivateApp.activate(); }
}

3. Declare the component

Add it to declarations.

@NgModule({
  declarations: [ AppComponent, ConfirmationComponent ],
  bootstrap: [ AppComponent ]
})
export class AppModule {}

4. Import NgxCanActivateAppModule

Then add your component to the module's initialization.

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.

<!doctype html>
<html lang="en">
<head></head>
<body>
  <app-root>
      <app-confirmation></app-confirmation>
  </app-root>
</body>
</html>

Keywords

FAQs

Package last updated on 02 Jul 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc