小编sud*_*mar的帖子

组件upperCaseComponent模板出错

它显示模板有错误,

错误:

  • 属性“结果”是私有的,只能在“upperCaseComponent”类中访问
  • 属性“mymessage”未在“upperCaseComponent”中声明

我的html

<input type="text" [(ngModel)]="mymessage"
<button (click)="clickMe()"> send</button>
<br><br>
<h1>{{result | json}}</h1>
Run Code Online (Sandbox Code Playgroud)

我的组件.ts

import {Component} from "@angular/core";
export class MyComponent {
private result: any;
constructor()
}
Run Code Online (Sandbox Code Playgroud)

angularjs angular-template angular

6
推荐指数
1
解决办法
9万
查看次数

标签 统计

angular ×1

angular-template ×1

angularjs ×1