Oscar LT
Oscar LT

Reputation: 797

Change ion-view view-title in every pages

I change the view-title with $scope.name = user.name and then I use <ion-view view-title="{{name}}">

In the same page the change is done, but in other pages you can see the previous name, not updating.

I try with <ion-view view-title>, <ion-view title>, with nav-bar... and nothing.

Help, please!

Upvotes: 0

Views: 637

Answers (2)

Anil Sharma
Anil Sharma

Reputation: 2962

Ok so according to your conversation you were not referring any controller to other view file where title was not shown . So to make data binding we need controller file referring to a view file either inline or through a route

So make controller for your view file and add $scope.title in each controller accordingly

Upvotes: 1

ashfaq.p
ashfaq.p

Reputation: 5477

According to me, your other pages must be under the scope of different controller. For a quick-fix you can try:

$rootScope.name = user.name

Upvotes: 0

Related Questions