Html 角度自定义标记不呈现和执行函数
我有一个html自定义标记。在我的next.component.ts文件中Html 角度自定义标记不呈现和执行函数,html,angular,typescript,angular-components,custom-tag,Html,Angular,Typescript,Angular Components,Custom Tag,我有一个html自定义标记。在我的next.component.ts文件中 @Component({ selector: 'nextbutton', template: ` <button (click) = "nextfunc()">Next</button> ` }) export class NextComponent{ nextfunc() { ==>>我的下一个.component.ts import { Component } fro
@Component({
selector: 'nextbutton',
template: ` <button (click) = "nextfunc()">Next</button> `
})
export class NextComponent{
nextfunc() {
==>>我的下一个.component.ts
import { Component } from '@angular/core';
@Component({
selector: 'nextbutton',
template: ` <button (click) = "nextfunc()">Next</button> `
})
export class NextComponent{
nextfunc() {
//do something
}
}
从'@angular/core'导入{Component};
@组成部分({
选择器:“下一个按钮”,
模板:`下一个`
})
导出类NextComponent{
nextfunc(){
//做点什么
}
}
当您使用标记作为时,指令/组件中的选择器是下一个按钮
<next-button></next-button>
将选择器更改为下一个按钮,或将标签更改为下一个按钮将选择器更改为
下一个按钮
,这样做有效。谢谢可能本地主机渲染工作缓慢。谢谢可能本地主机渲染速度很慢
import { Component } from '@angular/core';
@Component({
selector: 'nextbutton',
template: ` <button (click) = "nextfunc()">Next</button> `
})
export class NextComponent{
nextfunc() {
//do something
}
}
<next-button></next-button>