ionic framework - Angular 2 ES6 - Sending event from component -


i want send custom event component in es6, can listen in template <component (someevent)="somefunction()">, cannot make happen.

@component's properties ouputs or events breaking application. missing something?

this component declaration:

import {component, output} 'angular2/core';  @component({     selector: 'section-navigator-component',     templateurl: 'build/components/section_navigator/section_navigator.html',     inputs: [ 'resources', 'attr' ],     outputs: [ 'someevent' ] })   export class sectionnavigatorcomponent {     constructor() {      }      resourceclickhandler($event, resource) {      } } 

this should work in case:

import {component, output, eventemitter} 'angular2/core';  @component({     selector: 'section-navigator-component',     templateurl: 'build/components/section_navigator/section_navigator.html',     inputs: [ 'resources', 'attr' ],     outputs: [ 'someevent' ] })   export class sectionnavigatorcomponent {      constructor() {       this.someevent = new eventemitter();     }      resourceclickhandler($event, resource) {       this.someevent.emit(somevalue);     } } 

Comments

Popular posts from this blog

javascript - Laravel datatable invalid JSON response -

java - Exception in thread "main" org.springframework.context.ApplicationContextException: Unable to start embedded container; -

sql server 2008 - My Sql Code Get An Error Of Msg 245, Level 16, State 1, Line 1 Conversion failed when converting the varchar value '8:45 AM' to data type int -