angular2-custom-component

Why click function triggers twice for custom component in Angular 2

自作多情 提交于 2019-12-11 02:19:11
问题 My custom component click function is triggered twice - both custom component's event and sample level event are triggered. Here's my Plunker: https://plnkr.co/edit/wp2iWh7OStdPm5uXsWbP?p=preview 回答1: Because you have bound it twice on the child component and on the parent component. The mouseEvent propagates from the child component to the parent component by default. You can stop propagation of event to parent component. Template: <div (click)="divClick($event)">Custom Div Clcik here!</div>

Error encountered resolving symbol values statically. Calling function 'CreateCustomComponent', function calls are not supported

和自甴很熟 提交于 2019-12-08 02:01:53
问题 I am getting below error when creating my custom component. Error encountered resolving symbol values statically. Calling function 'CreateCustomComponent', function calls are not supporte d. Consider replacing the function or lambda with a reference to an exported function, resolving symbol cus_input my file like as below. Any one please give me a answer for below my code ? export class MyComponent { constructor() { console.log("Component created"); } } export function CreateCustomComponent(

Error encountered resolving symbol values statically. Calling function 'CreateCustomComponent', function calls are not supported

折月煮酒 提交于 2019-12-06 08:09:43
I am getting below error when creating my custom component. Error encountered resolving symbol values statically. Calling function 'CreateCustomComponent', function calls are not supporte d. Consider replacing the function or lambda with a reference to an exported function, resolving symbol cus_input my file like as below. Any one please give me a answer for below my code ? export class MyComponent { constructor() { console.log("Component created"); } } export function CreateCustomComponent( componentArgs: { selector: string, inputs: Array<string>, template: string }): Type<any> { let comp =