Angular2 Update variables between components

Asked

Viewed 342 times

1

I’m starting at the angular 2 and would like to know the best way to do the following: I have 2 Components, Toolbar.Component and profile.Component.

When the user updates the name of the logo and its photo (this already works) I need to update this in Toolbar (which today displays static information)

What’s the best way to do that? I wanted the variables to be available for every application because Toolbar will have a message logic based on the user’s profile, depending on what information is still missing for example.

Toolbar.component.html:

<a [routerLink]="['']" id="logo-container" class="brand-logo" >Logo xxxx</a>
<li  *ngIf="tokenAuthService.userSignedIn()">
      <a [routerLink]="['/perfil']" class="nav-picture" [ngStyle]="{'background-image': 'url(http://res.cloudinary.com/dgekdykfj/image/upload/v1492383265/x7qow7ayvvhyojw7d1mi.jpg)'}"></a>
</li>

I don’t know what more files would be needed to analyze, so I didn’t put them all here. Thank you

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.