Skip to content

Instantly share code, notes, and snippets.

@jrwebdev
Last active November 14, 2016 07:58
Show Gist options
  • Save jrwebdev/b6ba8ff7a9f5a31db5c2755ecb9f5c0d to your computer and use it in GitHub Desktop.
Save jrwebdev/b6ba8ff7a9f5a31db5c2755ecb9f5c0d to your computer and use it in GitHub Desktop.
Angular 1 vs Angular 2 Modules
// 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