app.config([ '$stateProvider', '$urlRouterProvider', function($stateProvider, $urlRouterProvider) { $urlRouterProvider.otherwise("/login"); $stateProvider.state('login', { url : "/login", templateUrl : "./login.html", controller : 'LoginCtrl' }).state('apply', { url : "/apply", templateUrl : "./apply.html", controller : 'ApplyCtrl' }).state('notice', { url : "/notice", templateUrl : "./notice.html", controller : 'NoticeCtrl' }).state('forgetPassword', { url : "/forgetPassword", templateUrl : "./forgetPassword.html", controller : 'ForgetPasswordCtrl' }) }]); app.controller('AppCtrl', [ '$rootScope', '$scope', '$http', '$timeout', '$state', function($rootScope, $scope, $http, $timeout, $state, $window) { // var d = dialog({ // title : '温馨提示:', // content : '报名系统正在测试,未正式开放。正式报名开始前,所有数据将被清空。', // ok : function() { // }, // okValue : '确定', // width : 350 // }); // d.showModal(); $rootScope.appTitle="北京外国语大学保送生报名系统"; $rootScope.goUrl = function(url, ctrl) { $state.go(url); return false; } $rootScope.errorMsg = function(msg) { var d = dialog({ title : '错误提示', content : msg, ok : function() { }, okValue : '确定', width : 350 }); d.showModal(); } $rootScope.dialogMsg = function(msg, fn) { var vFn = fn == undefined ? (function() { }) : fn var d = dialog({ title : '操作提示', content : msg, ok : vFn, okValue : '确定', width : 320 }); d.showModal(); } } ]);