The serve-and-sync tasks wait for `_copy-example-boilerplate` to finish Differentiates app compile, spec compile, and test failures StyleGuide (for documentators) up-to-date
		
			
				
	
	
		
			44 lines
		
	
	
		
			949 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			44 lines
		
	
	
		
			949 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
(function(app) {
 | 
						|
 | 
						|
// #docregion
 | 
						|
// #docregion class-w-annotations
 | 
						|
app.AppComponent =
 | 
						|
    // #docregion component
 | 
						|
    ng.core.Component({
 | 
						|
      selector: 'my-app',
 | 
						|
    // #enddocregion
 | 
						|
    // #docregion view
 | 
						|
      template: '<h1 id="output">My First Angular 2 App</h1>'
 | 
						|
    })
 | 
						|
    // #enddocregion
 | 
						|
    // #docregion class
 | 
						|
    .Class({
 | 
						|
      constructor: function () { }
 | 
						|
    });
 | 
						|
    // #enddocregion
 | 
						|
// #enddocregion
 | 
						|
 | 
						|
// #docregion bootstrap
 | 
						|
document.addEventListener('DOMContentLoaded', function() {
 | 
						|
  ng.platformBrowserDynamic.bootstrap(app.AppComponent);
 | 
						|
});
 | 
						|
// #enddocregion
 | 
						|
// #enddocregion
 | 
						|
 | 
						|
})(window.app || (window.app = {}));
 | 
						|
 | 
						|
/* Non DSL Approach */
 | 
						|
(function(app) {
 | 
						|
 | 
						|
// #docregion no-dsl
 | 
						|
app.AppComponent = function  AppComponent () {}
 | 
						|
 | 
						|
app.AppComponent.annotations = [
 | 
						|
  new ng.core.Component({
 | 
						|
    selector: 'my-app',
 | 
						|
    template: '<h1 id="output">My First Angular 2 App</h1>'
 | 
						|
  })
 | 
						|
];
 | 
						|
// #enddocregion
 | 
						|
})(window.app || (window.app = {}));
 |