本文整理匯總了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);
}