I'm learning Angular 2 so still not familiar with how it implements plugins. I'm trying to implement angular bootstrap toggle: http://ziscloud.github.io/angular-bootstrap-toggle/
Instructions say: As soon as you've got all the files downloaded and included in your page you just need to declare a dependency on the ui.toggle module: angular.module('myModule', ['ui.toggle']);
I'm not sure what that means. I just got used to declaring them in package.json and app.module.ts.
I don't see anywhere in these files where I might add that line.
package.json looks like this:
{
"name": "arv2",
"dependencies": {
"@angular/common": "^4.0.0",
"@angular/compiler": "^4.0.0",
...
"mydatepicker": "^2.0.21",
"ng2-validation": "^4.2.0",
},
"devDependencies": {
"@angular/cli": "1.0.2",
"@angular/compiler-cli": "^4.0.0",
...
"webpack-dev-server": "~2.4.2",
"webpack-hot-middleware": "^2.18.0"
}
}
and app.module.ts looks like this:
import { BrowserModule } from '@angular/platform-browser';
import { NgModule, APP_INITIALIZER } from '@angular/core';
...
import { CustomFormsModule } from 'ng2-validation';
@NgModule({
declarations: [
AppComponent,
SwitchClientComponent,
SwitchClientPipe,
...
],
imports: [
BrowserModule,
...
],
providers: [
],
bootstrap: [AppComponent]
})
export class AppModule { }
finally, the actual page I'm trying to implement it on looks like this:
import { Component, OnInit } from '@angular/core';
import { ActivatedRoute, Router } from '@angular/router';
@Component({
selector: 'app-switch-client',
templateUrl: './switch-client.component.html',
styleUrls: ['./switch-client.component.scss']
})
export class SwitchClientComponent implements OnInit {
...
}