angular - In angular2 need to send data from one component to another component -


after entering mobile no login component verify otp otp component need mobile no , country code user entered pass parameters api in otp service. need pass data login otp component how perform in angular2 ?

sandip right. example define following shared variable inside 'shareddataservice':

import {  injectable } '@angular/core';  @injectable() export class shareddataservice{     hasuserloggedin: boolean; } 

then use service inside 'appcomponent':

@component({   providers: [ shareddataservice ] }) 

the variable can used across whole app.


Comments

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -