本文整理汇总了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)
}
示例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;
}
示例4: gotoAchievementDetail
public gotoAchievementDetail(achievementId:any)
{
Gaia.api.goto(Branches.ACHIEVEMENTS_DETAIL, {slug: achievementId.id});
}
示例5: onDeeplink
public onDeeplink(event:GaiaHistoryEvent):void
{
var achievementId:string = Gaia.api.getParam(Param.SLUG);
this.getAchievement(achievementId);
}