3.0.1 • Published 10 years ago

angular2-component-outlet v3.0.1

Weekly downloads
18
License
MIT
Repository
github
Last release
10 years ago

angular2-component-outlet

npm version CircleCI

$ npm install --save angular2-component-outlet

Current Angular Version: 2.0.2

Live Demo: Plunker


ComponentOutlet is a directive to create dynamic component.

Example:

@Component({
  selector: 'my-app',
  template: `
    <div *componentOutlet="template; context: self; selector:'my-component'"></div>
  `
})
export class AppComponent {
  self = this;

  template = `
  <div>
    <p>Dynamic Component</p>
  </div>`;
}

@NgModule({
  providers: [
    provideComponentOutletModule({
      imports: [CommonModule]
    })
  ],
  declarations: [ComponentOutlet]
})
class AppModule {}

Result:

<my-app>
    <my-component>
        <div>
            <p>Dynamic Component</p>
        </div>
    </my-component>
</my-app>

Notes

  • ComponentOutlet needs RuntimeCompiler provided by platform-browser-dynamic. You cannot use platformBrowser instead of platformBrowserDynamic.
    • For AoT compilation, you can use platformBrowserDynamic().bootstrapModuleFactory().
3.0.1

10 years ago

3.0.0

10 years ago

2.0.1

10 years ago

2.0.0

10 years ago

0.2.0

10 years ago

0.1.5

10 years ago

0.1.4

10 years ago

0.1.3

10 years ago

0.1.2

10 years ago

0.1.1

10 years ago

0.1.0

10 years ago

0.0.4

10 years ago

0.0.3

10 years ago

0.0.2

10 years ago

0.0.1

10 years ago