2015-06-02 20:44:32 -04:00
|
|
|
import * as ng from './angular2';
|
2015-05-20 20:19:46 -04:00
|
|
|
// the router should have its own SFX bundle
|
2015-05-04 20:57:28 -04:00
|
|
|
// But currently the module arithemtic 'angular2/router_sfx - angular2/angular2',
|
|
|
|
// is not support by system builder.
|
|
|
|
import * as router from './router';
|
|
|
|
|
2015-06-02 20:44:32 -04:00
|
|
|
var angular: AngularOne = <any>ng;
|
|
|
|
(<AngularWindow>window).angular = angular;
|
|
|
|
|
|
|
|
var _prevAngular = (<AngularWindow>window).angular;
|
2015-04-13 19:48:04 -04:00
|
|
|
|
|
|
|
|
2015-06-02 20:44:32 -04:00
|
|
|
angular.router = router;
|
2015-04-13 19:48:04 -04:00
|
|
|
/**
|
|
|
|
* Calling noConflict will restore window.angular to its pre-angular loading state
|
2015-05-04 20:57:28 -04:00
|
|
|
* and return the angular module object.
|
2015-04-13 19:48:04 -04:00
|
|
|
*/
|
|
|
|
angular.noConflict = function() {
|
2015-06-02 20:44:32 -04:00
|
|
|
(<AngularWindow>window).angular = _prevAngular;
|
2015-04-13 19:48:04 -04:00
|
|
|
return angular;
|
|
|
|
};
|
|
|
|
|
2015-06-02 20:44:32 -04:00
|
|
|
interface AngularOne {
|
|
|
|
router: any;
|
|
|
|
noConflict(): any;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface AngularWindow extends Window {
|
|
|
|
angular: any;
|
|
|
|
}
|