Dynamic title from a json file

Hi,

I’m starting with angularjs and Iconic and I have one simple question…

I have a controller which get some data from a remote json, I want to change the nav bar title with a value from that json.

function PostDetailController($scope, $stateParams, $http){
	$scope.title = 'BLA';
	$http.get('/jsons/post.json').success(
		function(data, status, headers, config) {
			$scope.post = data;
			$scope.title = data.title;
		}
	);
}

The title is always BLA

Any help ? Thanks!

1 Like

Currently, Ionic doesn’t updating the title. At least I don’t think it does. Ionci does not listen for changes to it.

I’ve just sent a pull request that allows this. https://github.com/driftyco/ionic/pull/501

2 Likes