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

sql - VB.NET Operand type clash: date is incompatible with int error -

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

python - TypeError: Scalar value for argument 'color' is not numeric in openCV -