I don’t think my app.js is loading correctly. When i check all other examples, my code look ok. I put debugger, console.log and alert codes into that config function but non of them executed. How can i make sure that my routes are actually loaded?
So the issue maybe from how your project is setup.
Normally, you wounldn’t place your index.html as a template, since your app will get rendered into index.html
I already added those commas, that’s not a problem.
I changed templateUrl’s as “/templates/login.html” and “/templates/register.html”. Those files are existing in templates directory. But as i said, i get an empty page.
I tried to create a codepen too. In codepen, i can see some content but i can’t in my local. I’ll keep try to debugging this and post an update when i solve what is wrong.
I have created an blank application to take it simple. Am i missing something here?
Here is full code:
index.html
<link href="lib/ionic/css/ionic.css" rel="stylesheet">
<link href="css/style.css" rel="stylesheet">
<!-- IF using Sass (run gulp sass first), then uncomment below and remove the CSS includes above
<link href="css/ionic.app.css" rel="stylesheet">
-->
<!-- ionic/angularjs js -->
<script src="lib/ionic/js/ionic.bundle.js"></script>
<!-- cordova script (this will be a 404 during development) -->
<script src="cordova.js"></script>
<!-- your app's js -->
<script src="js/app.js"></script>
// Ionic Starter App
angular.module('starter', ['ionic'])
.run(function($ionicPlatform) {
$ionicPlatform.ready(function() {
// Hide the accessory bar by default (remove this to show the accessory bar above the keyboard
// for form inputs)
if(window.cordova && window.cordova.plugins.Keyboard) {
cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true);
}
if(window.StatusBar) {
StatusBar.styleDefault();
}
});
})
.config(function($stateProvider, $urlRouterProvider) {
$stateProvider.state('login', {
url: '/',
templateUrl: 'login.html'
});
$urlRouterProvider.otherwise("/");
})
login.html is at same directory with index.html file. All i see is “Ionic Blank Starter” at the header. Thanks for all the help by the way. (Some html tags gone missing when i surround them with code block while writing this - body and html tags are not shown in answer)