Set the component / app Angular 2 in the body tag

1

I would like to set the <body> tag as the root of my Angular application 2 instead of creating a <my-app> (eg) child tag.

    
asked by anonymous 17.06.2017 / 06:56

1 answer

0

Set body as the root component chooser for your application.

Something like

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

@Component({
    selector: 'body',
    template: '<h1>{{mensagem}}</h1>'
})
export class AppComponent { 
    String mensagem = "Minha primeira aplicação Angular 2";
}
    
18.06.2017 / 01:14