Last active
November 14, 2016 07:58
-
-
Save jrwebdev/b6ba8ff7a9f5a31db5c2755ecb9f5c0d to your computer and use it in GitHub Desktop.
Angular 1 vs Angular 2 Modules
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Angular 1 | |
const module = angular.module('myModule', [ModuleB, ModuleC]); | |
module.component('myComponent', MyComponent); | |
module.service('myService', MyService); | |
/***************************************************************/ | |
// Angular 2 | |
import { NgModule } from '@angular/core'; | |
@NgModule({ | |
imports: [ | |
ModuleB, | |
ModuleC | |
], | |
declarations: [ | |
MyComponent | |
], | |
providers: [ | |
MyService | |
] | |
}) | |
export class MyModule { } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment