Skip to content

Instantly share code, notes, and snippets.

@k0d3d
Created September 10, 2014 14:27
Show Gist options
  • Save k0d3d/9981cec34ef29f62228c to your computer and use it in GitHub Desktop.
Save k0d3d/9981cec34ef29f62228c to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html>
<head>
<title></title>
<script type="text/javascript" src="angular.min.js"></script>
<script type="text/javascript" src="angular-ui-router.js"></script>
</head>
<body>
<nav id="mainmenu" class="mainmenu" ng-app="demoApp">
<ul>
<li class="logo-wrapper"><a ng-href="#/admin"><img src="{{asset(Config::get("app.logo_url"))}}" alt="{{{ Lang::get("application.title")}}}"></a></li>
<li>
<a ng-href="#/admin">Home</a>
</li>
<li>
<a ng-href="#/admin/providers">Providers</a>
</li>
<li>
<a ng-href="#/about">About</a>
</li>
<li>
<a ui-sref="admin.contact">Contact</a>
</li>
</ul>
<div ui-view>
</div>
</nav>
<script type="text/javascript">
//below are the states I have defined:
//
var app = angular.module('demoApp',[
'ui.router',
]);
app.config(['$stateProvider', function ($stateProvider) {
$stateProvider.state("admin", {
url : '/admin',
views: {
'' : {
template : 'Admin Dashboard <div ui-view="yada"></div>'
}
}
})
.state("admin.contact", {
url : '/contact',
views: {
"yada@admin" : {
template : "contact form"
}
}
})
.state("about", {
url : '/about',
template : "about form"
})
// .state("admin.providers", {
// url : '/admin/providers',
// template : "providers"
// })
// .state("admin.lists", {
// url : '/admin/lists',
// templateUrl : "/client-templates?key=admin-lists"
// }).state("admin.lists.providers", {
// templateUrl : "/client-templates?key=admin-lists-providers",
// url : '/admin/lists/providers',
// resolve : {
// title : function () {
// return "Providers/Business Categories";
// }
// },
// controller : "ProviderCategoryCtrl"
// }).state("admin.lists.products", {
// url : '/admin/lists/products',
// templateUrl : "/client-templates?key=admin-lists-products",
// resolve : {
// title : function () {
// return "Product/Service Categories";
// }
// },
// controller : "ProductCategoryCtrl"
// });
}]);
app.controller("AdminCtrl", ['$scope', '$state', function ($scope, $state) {
//$state.go("admin");
}]);
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment