In my template, I’m using code like this:
<ion-view view-title="{{user.nickname}}">
But if I fill nickname property of user object with value, nothing is being shown in the header.
Seem like I can’t access scope from ion-view directive.
In my template, I’m using code like this:
<ion-view view-title="{{user.nickname}}">
But if I fill nickname property of user object with value, nothing is being shown in the header.
Seem like I can’t access scope from ion-view directive.
And I mean beta v 14.
Can you reproduce this in a codepen? In this codepen I made it is using the scope defined variable and if you click the button it changes the title: http://codepen.io/anon/pen/QwvaPy?editors=101
As of beta 14 I’ve found that adding data inside of directive attributes like that has been buggy. What seems to work better for this is to place it inside of an <ion-nav-title>
tag like this:
<ion-nav-title>{{user.nickname}}</ion-nav-title>
Actually you can, In my project I used it like this:
<ion-view title='{{user.name}}'>
this has solved the problem
If the value set inicial in controller, without any processing, show in the title. But if it is obtained after consulting a service, it is not updated. With the same procedure without problem list is updated.
Example:
.controller('RankingMenuCtrl', ['$scope', '$stateParams', 'RankingServ', 'AuthServ',
function ($scope, $stateParams, RankingServ, AuthServ) {
$scope.titulo = 'inicial';
$scope.opciones = {};
var dato_config = {};
dato_config = AuthServ.getConfig();
var divId = $stateParams.divId;
var categoria = dato_config.categoria.toLowerCase();
RankingServ.getConfig(categoria).then(function (datosRanking) {
var datosPorDiv = RankingServ.getDatosByDiv(datosRanking, divId);
$scope.titulo = datosPorDiv.division+' División';
$scope.opciones = datosPorDiv.opciones;
});
}]);
<ion-view title="{{titulo}}">
<ion-content>
<ion-list>
<ion-item ng-repeat="opcion in opciones"
item="opciones"
class="item-icon-right"
href="#/{{opcion.url}}" >
{{opcion.menu}}
<i class="icon ion-ios-arrow-forward energized"></i>
</ion-item>
</ion-list>
<br />
<p>{{titulo}}</p>
</ion-content>
</ion-view>
When running, the title is seen as “initial” and then in paragraph
is correctly updated “… Division”
Use: ionic-nightly1154. Something wrong?