• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

TypeScript entcore.routes类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了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;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
TypeScript entcore.sniplets类代码示例发布时间:2022-05-25
下一篇:
TypeScript entcore.notify类代码示例发布时间:2022-05-25
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap