route.js 831 Bytes
Newer Older
manxiaoqiang committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
(function(){
    var tempVersion = new Date().getTime();
    
    angular.module("app.home")
        .config(['$stateProvider',"$urlRouterProvider",function ($stateProvider,$urlRouterProvider) {
        var menu = "home",html = ["home","main","demolist"];
        $stateProvider.state(menu,{
            url:"",
            templateUrl: '/template/menu/collect.html?r='+tempVersion,
            controller: "collectCtrl"
        });
        html.forEach(function(h){
            $stateProvider.state('home.' + h,{
                url:"/" + menu + "/" + h,
                views:{
                    "home@":{
                        templateUrl: "/template/" + menu + "/" + h + '.html?r='+tempVersion,
                        controller: h +"Ctrl"
                    }
                }
            });
        });
    }]);
})();