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


TypeScript entcore.routes類代碼示例

本文整理匯總了TypeScript中entcore.routes的典型用法代碼示例。如果您正苦於以下問題:TypeScript routes類的具體用法?TypeScript routes怎麽用?TypeScript routes使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


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

示例1:

routes.define(function($routeProvider){
    $routeProvider
        .when('/dashboard', {
            action: 'dashboard'
        })
        .when('/dashboard/student', {
            action: 'dashboardStudent'
        })
        .when('/dashboard/teacher/correction/:subjectScheduledId?', {
            action: 'dashboardTeacherCorrection'
        })
        .when('/dashboard/teacher/library', {
            action: 'dashboardTeacherLibrary'
        })
        .when('/subject/edit/:subjectId/', {
            action: 'editSubject'
        })
        .when('/subject/edit/simple/:subjectId/', {
            action: 'editSimpleSubject'
        })
        .when('/subject/create/simple/:folderId?', {
            action: 'editSimpleSubject'
        })
        .when('/subject/copy/preview/perform/:subjectId/', {
            action: 'previewPerformSubjectCopy'
        })
        // perform as student
        .when('/subject/copy/perform/:subjectCopyId/', {
            action: 'performSubjectCopy'
        })
        .when('/subject/edit/simple/preview/:subjectPreviewId/', {
            action: 'previewEditSubjectSimpleCopy'
        })
        .when('/subject/copy/perform/simple/:subjectCopyId/', {
            action: 'performSimpleSubjectCopy'
        })
        .when('/subject/copy/view/preview/:subjectId/', {
            action: 'previewViewSubjectCopy'
        })
        // view as student
        .when('/subject/copy/view/:subjectCopyId/', {
            action: 'viewSubjectCopy'
        })
        .when('/subject/copy/view/:subjectId/:subjectCopyId/', {
            action: 'viewSubjectCopyAsTeacher'
        })
        .when('/dashboard/teacher/archive/:subjectScheduledId?', {
            action: 'dashboardTeacherArchive'
        })
        .when('/dashboard/teacher/archive/:subjectId/:subjectCopyId', {
            action: 'dashboardTeacherArchiveCopy'
        })
        .otherwise({
            redirectTo: '/dashboard'
        });
});
開發者ID:OPEN-ENT-NG,項目名稱:exercizer,代碼行數:56,代碼來源:app.ts

示例2:

import { routes, ng } from 'entcore';
import { activationController } from './controllers/activation';
import { forgotController } from './controllers/forgot';
import { resetController } from './controllers/reset';
import { loginController } from './controllers/login';

routes.define(function($routeProvider) {
	$routeProvider
		.when('/id', {
			action: 'actionId'
		})
		.when('/password', {
	  		action: 'actionPassword'
		})
		.otherwise({
		  	redirectTo: '/'
		})
});

ng.controllers.push(activationController);
ng.controllers.push(forgotController);
ng.controllers.push(resetController);
ng.controllers.push(loginController);

console.log('app');
開發者ID:entcore,項目名稱:entcore,代碼行數:25,代碼來源:app.ts

示例3:

import { printController } from "./controllers/printController";
import { recipientList } from "./directives/recipientList";
import { switchSearch } from "./directives/switchSearch";

routes.define(function ($routeProvider) {
    $routeProvider
        .when("/read-mail/:mailId", {
            action: "readMail"
        })
        .when("/write-mail/:id", {
            action: "writeMail"
        })
        .when("/write-mail/:id/:type", {
            action: "writeMail"
        })
        .when("/write-mail", {
            action: "writeMail"
        })
        .when('/inbox', {
            action: 'inbox'
        })
        .when('/printMail/:mailId', {
            action: 'viewPrint'
        })
        .otherwise({
            redirectTo: "/inbox"
        })
});

ng.controllers.push(conversationController);
ng.controllers.push(printController);
ng.directives.push(recipientList);
開發者ID:entcore,項目名稱:entcore,代碼行數:32,代碼來源:app.ts

示例4:

import { ng, routes } from 'entcore';
import * as controllers from './controllers';

for(let controller in controllers){
    ng.controllers.push(controllers[controller]);
}

routes.define(function($routeProvider){
	$routeProvider
		.otherwise({
			action: 'defaultView'
		});
})
開發者ID:entcore,項目名稱:skeletons,代碼行數:13,代碼來源:app.ts

示例5:

ng.controllers.push(view);
ng.controllers.push(main);

ng.directives.push(gridCell);
ng.directives.push(gridRow);
ng.directives.push(gridResizable);
ng.directives.push(drawingGrid);
ng.directives.push(panel);
ng.directives.push(cssEditor);

routes.define(function ($routeProvider) {
    $routeProvider
        .when('/website/:siteId', {
            action: 'site'
        })
        .when('/website/:siteId/:pageId', {
            action: 'page'
        })
        .when('/preview/:siteId/:pageId', {
            action: 'previewPage'
        })
        .when('/preview/:siteId', {
            action: 'previewSite'
        })
        .when('/list-sites', {
            action: 'listSites'
        })
        .otherwise({
            redirectTo: '/list-sites'
        });
});
開發者ID:web-education,項目名稱:pages,代碼行數:31,代碼來源:app.ts

示例6:

routes.define(function ($routeProvider) {
    if (window.location.href.indexOf('mon-compte') !== -1) {
        $routeProvider
            .when('/edit-user/:id', {
                action: 'editUser'
            })
            .when('/edit-user-infos/:id', {
                action: 'editUserInfos'
            })
            .when('/edit-me', {
                action: 'editMe'
            })
            .when('/themes', {
                action: 'themes'
            })
            .otherwise({
                redirectTo: 'edit-me'
            });
    }
    else {
        $routeProvider
            .when('/search', {
                action: 'directory'
            })
            .when('/myClass', {
                action: 'myClass'
            })
            .when("/user-view/:userId", {
                action: "viewUser"
            })
            .when('/:userId', {
                action: 'viewUser'
            })
            .when('/group-view/:groupId', {
                action: 'viewGroup'
            })
            .otherwise({
                redirectTo: '/myClass'
            });
    }
});
開發者ID:entcore,項目名稱:entcore,代碼行數:41,代碼來源:app.ts


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