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


TypeScript Gaia.api類代碼示例

本文整理匯總了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;未經允許,請勿轉載。