javascript - Change variable or call funtion from a component from an other component -


this case :

i have component :

@component({   selector: 'home',   templateurl: './administration.html',    directives: [directivetest] }) export class administration {   hello : string;    constructor(private http: http) {   }    ngoninit() {     //init stuff here   }    callme(value) {     alert("call you" + this.hello );   } } 

and template :

<h3>test administration </h3>  <directivetest></directivetest> 

this directive :

@component({   selector: 'directivetest',   templateurl: './directivetest.html' }) export class directivetest{    klickme() {     //call  administration  function (callme(value)) or change value????????????   } } 

is there way change variable or call function "directive" component,

what should :

  1. first make service ( component without selector)
  2. put data , related methods in service.
  3. inject service in both component.

Comments

Popular posts from this blog

SVG stroke-linecap doesn't work for circles in Firefox? -

routes - Laravel 4 Wildcard Routing to Different Controllers -

cross browser - XSLT namespace-alias Not Working in Firefox or Chrome -