Hi. I have newbie question.
I need some really basic AngularJS in my app. I made my popup work and then added ion-nav-view. Both elements works, but not simultaneously. Now ion-nav-view works perfect, but when i change
body ng-app="starter"
to
body ng-app="starter" ng-controller="PopupCtrl"
app turns into blank site.
It must be some small mistake but i can’t find, where it is. Can anyone help me? My app.js:
angular.module('starter', ['ionic'])
.run(function($ionicPlatform) {
$ionicPlatform.ready(function() {
if (window.cordova && window.cordova.plugins.Keyboard) {
cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true);
}
if (window.StatusBar) {
StatusBar.styleDefault();
}
});
})
angular.module('starter', ['ionic'])
.controller('PopupCtrl', function($scope, $ionicPopup, $timeout) {
$scope.showAlert = function() {
var alertPopup = $ionicPopup.alert({
title: Alert',
template: 'Alert text'
});
};
});
angular.module('starter', ['ionic'])
.config(function($stateProvider, $urlRouterProvider) {
$stateProvider
.state('list', {
url: '/1',
templateUrl: 'list.html'
})
.state('info', {
url: '/2',
templateUrl: 'info.html'
})
$urlRouterProvider.otherwise("/1");
})