本文整理汇总了TypeScript中sidewalk.Sidewalk.getComponent方法的典型用法代码示例。如果您正苦于以下问题:TypeScript Sidewalk.getComponent方法的具体用法?TypeScript Sidewalk.getComponent怎么用?TypeScript Sidewalk.getComponent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sidewalk.Sidewalk
的用法示例。
在下文中一共展示了Sidewalk.getComponent方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: 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);
});
示例2: run
});
//TODO sort out using
Sidewalk.registerComponent({
name: 'listitem',
template: sectionlistItemTemplate
});
Sidewalk.registerComponent({
name: 'bar',
template: actionbarTemplate,
});
let bar = Sidewalk.getComponent('bar').attachTo(document.querySelectorAll('body')[0]).render();
let list = Sidewalk.getComponent('list').attachTo(document.querySelectorAll('body')[0]).render();
let listitems = [];
export function run() {
let listitems = [];
let sectionsModel = Sidewalk.getModel('sections');
sectionsModel.getAll(function(data) {
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) {