當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript IUrlRouterProvider.otherwise方法代碼示例

本文整理匯總了TypeScript中angular-ui-router.IUrlRouterProvider.otherwise方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript IUrlRouterProvider.otherwise方法的具體用法?TypeScript IUrlRouterProvider.otherwise怎麽用?TypeScript IUrlRouterProvider.otherwise使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在angular-ui-router.IUrlRouterProvider的用法示例。


在下文中一共展示了IUrlRouterProvider.otherwise方法的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: function

	function($stateProvider: IStateProvider,
		$urlRouterProvider: IUrlRouterProvider) {
		// App Routing
		$urlRouterProvider.otherwise('/dashboard');
 
 if(CONSTANTS.atlas.ui.frontendOnly){
		$stateProvider
			.state('dashboard', {
				url: '/dashboard',
				template: '<dashboard></dashboard>',
				data: {
					menu: {
						name: 'Dashboard',
						icon: 'fa-dashboard'
					}
				}
			})
			// .state('page3', {
			// 	url: '/page3',
			// 	template: '<page3></page3>',
			// 	data: {
			// 		menu: {
			// 			name: 'Localization',
			// 			icon: 'fa-calculator'
			// 		}
			// 	}
			// });
        }}]);
開發者ID:chenhenry,項目名稱:chenhenry,代碼行數:28,代碼來源:app.routes.ts

示例2: function

            .config(["$urlRouterProvider", "$stateProvider", function (route: IUrlRouterProvider, stateProvider: IStateProvider) {
                route.otherwise("/state1/");

                stateProvider
                    .state("state1", {
                        url: "/state1/:detail",
                        templateUrl: "app/view1/view1.html",
                        controller: "View1Controller as vm"
                    })
                    .state("state2", {
                        url: "/state2",
                        templateUrl: "app/view2/view2.html",
                        controller: View2Controller,

                    })
                    .state("state3", {
                        url: "/state3/:detail/:viewId",
                        templateUrl: "app/view1/view1.html",
                        controller: "View1Controller as vm"// same view as View1
                    })
                    .state("state4", {
                        url: "/state4",
                        template: "<some-component></some-component>",
                    });
            }]);
開發者ID:AmirSasson,項目名稱:Angular1TypescriptSystemJs,代碼行數:25,代碼來源:boot.ts

示例3: routes

export function routes($stateProvider: IStateProvider, $urlRouterProvider: IUrlRouterProvider) {
    $stateProvider
        .state('app', {
            url: '/app',
            abstract: true,
            template: require('./App/app.html')
        });

    $urlRouterProvider.otherwise('/app/language');
}
開發者ID:egilsster,項目名稱:ionic-webpack-typescript,代碼行數:10,代碼來源:index.config.ts

示例4: routeConfig

function routeConfig($stateProvider: IStateProvider, 
    $urlRouterProvider: IUrlRouterProvider) {
    
    $stateProvider
        .state('login', {
            url: '/login',
            controller: 'LoginController as ctrl',
            templateUrl: 'login/login.html'
        })
    
    $urlRouterProvider.otherwise('/login');
}
開發者ID:martinmcwhorter,項目名稱:ng-ts-presentation,代碼行數:12,代碼來源:routeConfig.ts

示例5: constructor

    constructor($stateProvider: IStateProvider, $urlRouterProvider: IUrlRouterProvider){
        $urlRouterProvider.otherwise("/products");

        $stateProvider
            .state("products", {
                url: "/products",
                template: "<app-product-list></app-product-list>"
            })
            .state("productDetails", {
                url: "/product/:id", 
                template: "<app-product></app-product>"
            });
     }
開發者ID:ryanlangton,項目名稱:angular-upgrade,代碼行數:13,代碼來源:app.routes.ts

示例6:

export const Routes = (
    $stateProvider: IStateProvider,
    $urlRouterProvider: IUrlRouterProvider
) => {
    'ngInject'

    $urlRouterProvider.otherwise('/phones');
    $stateProvider
        .state('phones', {
            url: '/phones',
            template: '<phone-list></phone-list>'
        })
        .state('phoneDetail', {
            url: '/phones/:phoneId',
            template: '<phone-detail></phone-detail>'
        })
}
開發者ID:trotyl,項目名稱:angular.js-webpack-starter,代碼行數:17,代碼來源:routes.config.ts

示例7: registerRoutes

export function registerRoutes($stateProvider: IStateProvider,
                               $urlRouterProvider: IUrlRouterProvider,
                               $locationProvider: ILocationProvider){
    
    $urlRouterProvider.otherwise("/home");

    $stateProvider
        .state('home', {
            url: "/home",
            template: `<tar-home></tar-home>`
        })
        .state('about', {
            url: "/about",
            template: `<tar-about></tar-about>`
        });

    $locationProvider.html5Mode(true);
}
開發者ID:ericlink,項目名稱:ts-angular-redux-seed,代碼行數:18,代碼來源:routes.ts

示例8: function

angular.module('app').config(function ($stateProvider: IStateProvider , $urlRouterProvider: IUrlRouterProvider) {

    $urlRouterProvider.otherwise('lost');

    return $stateProvider
        .state('first', {
            url     : '',
            templateUrl: 'views/home.html'
        })
        .state('home', {
            url     : '/',
            // templateUrl: 'views/home.html'
            template: '<home></home>'
        })
        .state('lost', {
            url        : '/lost',
            templateUrl: 'views/lost.html',
            controller: function($scope, $state) {
                $scope.state = $state;
            }
        })
        .state('member list', {
            url        : '/memberEnumeration',
            templateUrl: 'views/memberList.html'
        })
        .state('member', {
            url         : '/members/:memberId',
//             controller  : 'memberCtr',
//             controllerAs: 'vm',
//             templateUrl : 'views/memberView.html'
            template: '<member></member>'
        })
        .state('member grid', {
            url        : '/memberGrid',
            templateUrl: 'views/memberGrid.html'
        })
        .state('map', {
            url        : '/map',
            templateUrl: 'views/map.html'
        });

});
開發者ID:r7lemieux,項目名稱:dash4,代碼行數:42,代碼來源:dashRte.ts

示例9: router

export function router($stateProvider:IStateProvider, $locationProvider:ILocationProvider, $urlRouterProvider:IUrlRouterProvider) {
    $locationProvider.html5Mode(true);
    // $locationProvider.hashPrefix('!');
    $urlRouterProvider.otherwise('/');
    // ACCOUNT
    $stateProvider.state('login', {
        url: '/login',
        views: {
            'master': {
                templateUrl: 'tpl/account/login.html',
                controller: 'loginController',
                controllerAs: 'vm'
            }
        }
    });
    // The Rest
    $stateProvider.state('home', {
        url: '/',
        views: {
            'master': {
                templateUrl: 'tpl/home.html',
                controller: 'homeController',
                controllerAs: 'vm'
            }
        }
    });
    $stateProvider.state('about', {
        url: '/about',
        views: {
            'master': {
                templateUrl: 'tpl/about.html',
                controller: 'aboutController',
                controllerAs: 'vm'
            }
        }
    });
    ///<vesta:ngRouter/>
}
開發者ID:VestaRayanAfzar,項目名稱:material-web-template,代碼行數:38,代碼來源:route.ts

示例10:

app.config(function ($stateProvider: IStateProvider, $urlRouterProvider: IUrlRouterProvider) {

    $urlRouterProvider.otherwise("/home");

    $stateProvider.state('home', {
        url: '/home',
        template: '<home></home>'
    })
    .state('flightBooking', {
        abstract: true,
        data: {
            protected: true
        },
        url: '/flightBooking',
        template: '<flight-booking></flight-booking>',
    })
    .state('flightBooking.passengerSearch', {
        url: '/passenger',
        template: '<passenger-search></passenger-search>',
        data: {
            protected: true
        }
    }).state('flightBooking.flightSearch', {
        url: '/flight',
        template: '<flight-search></flight-search>',
        data: {
            protected: true
        }
    }).state('flightBooking.flightEdit', {
        url: '/flight/:id',
        template: '<flight-edit></flight-edit>',
        data: {
            protected: true
        }
    });

});
開發者ID:CodebustersMarcel,項目名稱:full,代碼行數:37,代碼來源:app.ts


注:本文中的angular-ui-router.IUrlRouterProvider.otherwise方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。