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

TypeScript sidewalk.Sidewalk类代码示例

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

本文整理汇总了TypeScript中sidewalk.Sidewalk的典型用法代码示例。如果您正苦于以下问题:TypeScript Sidewalk类的具体用法?TypeScript Sidewalk怎么用?TypeScript Sidewalk使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了Sidewalk类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的TypeScript代码示例。

示例1: function

window.addEventListener('bubblegum.loaded', function() {

	Sidewalk.registerRoute({
		name: 'index',
		url: '/',
		onLoad: function(data) {
			Index.run();
		}
	});

	Sidewalk.registerRoutes({
		urls: [
			{
				name: "sections",
				url: "/sections",
				onLoad: function(data) {
					console.log('sections');
				}
			},
			{
				name: "sections.edit",
				url: "/sections/edit",
				onLoad: function(data) {
					console.log('edit');
				}
			},
			{
				name: "sections.search",
				url: "/sections/search",
				onLoad: function(data) {
					console.log('search');
				}
			},
			{
				name: "sections.remove",
				url: "/sections/remove",
				onLoad: function(data) {
					console.log('remove');
				}
			},
			{
				name: "sections.add",
				url: "/sections/add",
				onLoad: function(data) {
					console.log('add');
				}
			},
			{
				name: "sections.id",
				url: "/sections/(:number)",
				onLoad: function(data) {
					console.log('loading sections.id');
					Sections.run(data);
				}
			}
	]
	});

	Sidewalk.run();
});
开发者ID:Gyunu,项目名称:Bubblegum,代码行数:60,代码来源:index.ts


示例2: run

	export function run(id) {
		let listitems = [];
		let sectionsModel = Sidewalk.getModel('sections');
		console.log(sectionsModel);
		sectionsModel.getId(function(id, data) {
			console.log('model data');
			console.log(data);
		});
	}
开发者ID:Gyunu,项目名称:Bubblegum,代码行数:9,代码来源:sections.ts


示例3: function

			data.forEach(function(item) {
				let litem = Sidewalk.getComponent('listitem').attachTo(document.querySelectorAll('.list')[0]);
				//TODO expose these properties on the controller, i made the msitage of doing it on the controller so its not obvious and i wrote the fucker
				litem.template.title = item.name;
				litem.template.count = item.entries;
				litem.template.id = item.id;
				litem.render();
				litem.on('click', function(e) {
					
				});

				listitems.push(litem);
			});
开发者ID:Gyunu,项目名称:Bubblegum,代码行数:13,代码来源:index.ts


示例4: require

/*jslint node: true */
/*jslint white: true */
"use strict";

declare function require (id: string): any;
var Sidewalk = require('sidewalk').Sidewalk;
// var actionbarTemplate = require("html!../templates/actionbar.html");
// var sectionlistTemplate = require("html!../templates/sectionlist.html");
// var sectionlistItemTemplate = require("html!../templates/sectionlistitem.html");

export module Sections {

	Sidewalk.registerModel({
		name: "sections",
		root: "sections",
		urls: {
			"all": "(:all)",
			"id": "(:id)"
		}
	});

	export function run(id) {
		let listitems = [];
		let sectionsModel = Sidewalk.getModel('sections');
		console.log(sectionsModel);
		sectionsModel.getId(function(id, data) {
			console.log('model data');
			console.log(data);
		});
	}

}
开发者ID:Gyunu,项目名称:Bubblegum,代码行数:32,代码来源:sections.ts


示例5: require

/*jslint node: true */
/*jslint white: true */
"use strict";

declare function require (id: string): any;
var Sidewalk = require('sidewalk').Sidewalk;
var actionbarTemplate = require("html!../templates/actionbar.html");
var sectionlistTemplate = require("html!../templates/sectionlist.html");
var sectionlistItemTemplate = require("html!../templates/sectionlistitem.html");

export module Index {

	Sidewalk.registerModel({
		name: "sections",
		root: "sections",
		urls: {
			"all": "(:all)",
			"id": "(:id)"
		}
	});

	Sidewalk.registerComponent({
		name: 'list',
		template: sectionlistTemplate,
	});

	//TODO sort out using
	Sidewalk.registerComponent({
		name: 'listitem',
		template: sectionlistItemTemplate
	});
开发者ID:Gyunu,项目名称:Bubblegum,代码行数:31,代码来源:index.ts



注:本文中的sidewalk.Sidewalk类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
TypeScript sift.default函数代码示例发布时间:2022-05-25
下一篇:
TypeScript showdown.Converter类代码示例发布时间: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