How to declare, assign and call url from .state in app.js?
For example : url:/sample
url is sample but where i declare this sample that is url
any body can explain this.
Thanks in Advance,
The declaration of a state
could look as follows:
angular.module('myApp', ['ionic'])
.config(function ($stateProvider, $urlRouterProvider) {
$stateProvider
.state('page1', {
url: "/page1",
templateUrl: "page1.html"
}
})
$urlRouterProvider.otherwise("/page1");
});
The page1.html
would be a file which is located in the same directory as your index.html
, namely www
.