Template in Angular 2


Template
 The template tells Angular how to display the component. We can create html pages and navigate through site map/url for templateUrl

Benefits/Usages
  1.  Dynamic content rendered on separate page
  2. Code cleanliness more manageable
  3. Master / child page structure can be achieved
Syntax and Code Snippet

import { Component } from '@angular/core';
@Component({
  selector: 'myapp',
  template: `<h1>Hello {{name}}</h1>`
})
export class AppComponent
 {
  name = 'Angular2';
}

.html body section
<body>
<myapp>Loading Please wait ...</myapp>
</body>

Template in Angular 2 Reviewed by Rupesh on 04:07 Rating: 5

No comments:

All Rights Reserved by Technology from Developers Eye © 2014 - 2015
Powered By Blogger, Designed by Aadics
Disclaimers:: The information provided within this blogsite is for general informational purposes only. While we try to keep the information up-to-date and correct, there are no representations or warranties, express or implied, about the completeness, accuracy, reliability, suitability or availability with respect to the information, products, services, or related graphics contained in this blogsite for any purpose.The author does not assume and hereby disclaims any liability to any party for any loss, damage, or disruption caused by errors or omissions, whether such errors or omissions result from accident, negligence, or any other cause.

Contact Form

Name

Email *

Message *

Powered by Blogger.