当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript sidewalk.Sidewalk类代码示例

本文整理汇总了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;未经允许,请勿转载。