dotansimha / angular2-blaze-template

Angular 2 Component that allows you to load Blaze templates

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

<blaze-template>

Include Blaze templates in your angular-meteor application to use Blaze templates inside your Angular 2 app.

Quick start

In the command line: $ meteor npm install angular2-blaze-template

Import and include the BlazeComponent inside you Angular 2 Component:

import {Component} from "@angular/core";
import {bootstrap} from "@angular/platform-browser-dynamic";
import {BlazeTemplate} from 'angular2-blaze-template';

@Component({
  selector: "app",
  directives: [BlazeTemplate],
  template: `<blaze-template name="MyBlazeTemplate"></blaze-template>`,
})
class Main {
  constructor() {
  }
}

bootstrap(Main);

You can include Meteor's Blaze native templates with the blaze-template directive.

<blaze-template name="todoList"></blaze-template>

You can also specify context for the Template (default context is this that created by Angular 2 Component):

<blaze-template name="App_body" [context]="mainTemplateArgs"></blaze-template>

And define mainTemplateArgs in your Angular 2 Component.

Next steps

Read more on blaze-template, using parameters and binding Blaze templates to Angular's Component in the Angular2-Meteor website.

About

Angular 2 Component that allows you to load Blaze templates


Languages

Language:JavaScript 77.9%Language:TypeScript 22.1%