Meteor package wraps Angular2 NPM and exposes Angular2 to the outside world as a System.js module.
Current version of Angular2 - alpha-37.
Package has also built-in Babel and TypeScript languages support.
Note: current version is still experimental; stable version is expected in Meteor 1.2 only.
After package installation, you can start importing Angular2 core's components into your Meteor app the same way as you would do it in any other TypeScript or Babel app:
For example, create app.ts
file and add the next lines:
import {Component, bootstrap} from 'angular2/angular2';
@Component({
name: 'demo'
})
class Demo {
}
bootstrap(Demo);
Besides core components, other well-known Angular2 modules such as angular2/forms
, angular2/di
etc including angular2/router
are also
available for importing.
Package's TypeScript plugin asserts TypeScript diagnostics information (e.g. syntactic errors) to the console by default.
To get rid of them will need to reference Angular2 and Meteor declaration files in your .ts
files.
Luckily, package comes with these declation files included.
All you need to do is to add the next line at the top of each .ts
file:
/// <reference path="../.meteor/local/build/programs/server/assets/packages/barbatus_angular2/typings/all.d.ts" />'
This should fix compilation issues.