本文整理汇总了TypeScript中lib/gaia/api/Gaia.api类的典型用法代码示例。如果您正苦于以下问题:TypeScript api类的具体用法?TypeScript api怎么用?TypeScript api使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了api类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的TypeScript代码示例。
示例1: onBeforeGoto
/**
* @method onBeforeGoto
* @param {GaiaEvent} event
*/
private onBeforeGoto(event:GaiaEvent):void
{
// example implementation to disallow access to pages by checking certain things
var dataManager = DataManager.getInstance();
var pageData:IPageData = Gaia.api.getPage(event.routeResult[0].branch).data || {};
var isAuthenticated = true;
// check if we are on a user page, but are not loggedin
// this could happen when going to a deeplink or using the browsers back button
if (pageData.hasOwnProperty('auth') && pageData.auth == true && isAuthenticated)
{
// not allowed, goto home
Gaia.api.goto('/index');
}
// redirect to 'next' page if already authenticated
else if (pageData.hasOwnProperty('ifAuthenticated') && isAuthenticated)
{
Gaia.api.goto(pageData.ifAuthenticated);
}
else
{
// allowed, just continue
this._beforeGotoHijack();
}
//todo: add 'current' class to the current active page (leaf)
}
开发者ID:djordanpapilaya,项目名称:medialab-keesco-frontend,代码行数:33,代码来源:Main.ts
示例2: init
/**
* After calling super.init, your pages DOM is ready
*/
init()
{
super.init();
var achievementId:string = Gaia.api.getParam(Param.SLUG);
this.getAchievement(achievementId);
this.viewModel.currentAchievement(achievementId);
}
开发者ID:djordanpapilaya,项目名称:medialab-keesco-frontend,代码行数:10,代码来源:AchievementsDetailPageController.ts
示例3: copy
public copy(key:string):Deeplink
{
this[key] = Gaia.api.getParam(key);
return this;
}
开发者ID:djordanpapilaya,项目名称:medialab-keesco-frontend,代码行数:5,代码来源:Deeplink.ts
示例4: gotoAchievementDetail
public gotoAchievementDetail(achievementId:any)
{
Gaia.api.goto(Branches.ACHIEVEMENTS_DETAIL, {slug: achievementId.id});
}
开发者ID:djordanpapilaya,项目名称:medialab-keesco-frontend,代码行数:4,代码来源:AchievementsController.ts
示例5: onDeeplink
public onDeeplink(event:GaiaHistoryEvent):void
{
var achievementId:string = Gaia.api.getParam(Param.SLUG);
this.getAchievement(achievementId);
}
开发者ID:djordanpapilaya,项目名称:medialab-keesco-frontend,代码行数:5,代码来源:AchievementsDetailPageController.ts
注:本文中的lib/gaia/api/Gaia.api类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论