简体   繁体   English

意外的结束标记Angular2

[英]Unexpected closing tag Angular2

Im learning Angular2 with typscript and im stuck after first changes. 我用打字稿学习Angular2,在第一次更改后被卡住了。 Here is my problem. 这是我的问题。 My code is: 我的代码是:

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

@Component({
    selector: 'pm-app',
    template: `
        <div><h1>{{pageTitle}}</h1>
            <pm-prudcts></pm-products>
        </div>
    `
})
export class AppComponent {
    pageTitle: string = 'Acme Product Manager';
}

And im getting error with Component Products and div tag: 即时通讯与组件产品和div标签出现错误:

Template parse errors:
Unexpected closing tag "pm-products" ("
        <div><h1>{{pageTitle}}</h1>
            <pm-prudcts>[ERROR ->]</pm-products>
        </div>
    "): AppComponent@2:24
Unexpected closing tag "div" ("
        <div><h1>{{pageTitle}}</h1>
            <pm-prudcts></pm-products>
        [ERROR ->]</div>
    "): AppComponent@3:8

There is a typo in your component template. 组件模板中有一个错字。 Change <pm-prudcts> to <pm-products> : <pm-prudcts>更改为<pm-products>

@Component({
    selector: 'pm-app',
    template: `
        <div><h1>{{pageTitle}}</h1>
            <pm-products></pm-products> 
        </div>
    `
})

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM