raju
raju

Reputation: 6936

How to use angular2 on a part of web page only

I am a learner of angular-2. I have a query that can I use angular2 on a specific part of web page. e.g. I only want to use *ngFor utility of angular2 but I want that for only a div area. While it is possible in Angular-1, is it possible in angular2.

Upvotes: 1

Views: 1147

Answers (1)

Atal Kishore
Atal Kishore

Reputation: 4748

In the main component selector just add the selector of the div

import { Component }          from '@angular/core';


@Component({
  selector: 'my-app', // here add the selector for your div
  template: `
    <router-outlet></router-outlet>
  `,
})
export class AppComponent {        

}

Upvotes: 2

Related Questions