I am following some examples from a website, and my current html is:
<!DOCTYPE html> <html ng-app="Test"> <head> <meta charset="utf-8"> <meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width"> <title></title> <link href="lib/ionic/css/ionic.css" rel="stylesheet"> <link href="css/style.css" rel="stylesheet"> <script src="lib/ionic/js/ionic.bundle.js"></script> <script src="cordova.js"></script> <script src="js/app.js"></script> </head> <body> <ion-nav-bar class="bar-positive"> <ion-nav-back-button class="button-icon ion-arrow-left-c"> </ion-nav-back-button> </ion-nav-bar> <ion-nav-view> </ion-nav-view> <script type="text/ng-template" id="main.html"> <ion-view view-title="Home"> <ion-content > <p> Test </p> </ion-content> </ion-view> </script> </body> </html>
And js:
var app = angular.module('Test', ['ionic']); app.config(function($stateProvider, $urlRouterProvider) { $urlRouterProvider.otherwise('/') $stateProvider.state('index', { url: '/', templateUrl: 'main.html', controller: 'TestCtrl' }) }) app.controller('TestCtrl', function($scope) { })
Now the documentation states that view-title = "Test" should fill out the title in ion-navbar. But it doesn't seem to work. Does anyone know what is going wrong?
source share