本文整理汇总了TypeScript中angular2/src/core/render/api.Renderer类的典型用法代码示例。如果您正苦于以下问题:TypeScript Renderer类的具体用法?TypeScript Renderer怎么用?TypeScript Renderer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Renderer类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的TypeScript代码示例。
示例1: _listenGlobal
private _listenGlobal(
renderer: Renderer, eventTarget: string, eventName: string, unlistenId: number) {
var unregisterCallback = renderer.listenGlobal(
eventTarget, eventName,
(event) => this._eventDispatcher.dispatchRenderEvent(null, eventTarget, eventName, event));
this._renderStore.store(unregisterCallback, unlistenId);
}
开发者ID:LordBinary,项目名称:angular,代码行数:7,代码来源:renderer.ts
示例2: _selectRootElement
private _selectRootElement(renderer: Renderer, selector: string, elId: number) {
this._renderStore.store(renderer.selectRootElement(selector), elId);
}
开发者ID:LordBinary,项目名称:angular,代码行数:3,代码来源:renderer.ts
示例3: setElementProperty
setElementProperty(renderElement: any, propertyName: string, propertyValue: any) {
var debugEl = getDebugNode(renderElement);
if (isPresent(debugEl) && debugEl instanceof DebugElement) {
debugEl.properties.set(propertyName, propertyValue);
}
return this._delegate.setElementProperty(renderElement, propertyName, propertyValue);
}
开发者ID:0oAimZo0,项目名称:Angular2Learning,代码行数:7,代码来源:debug_renderer.ts
示例4: listen
listen(renderElement: any, name: string, callback: Function) {
var debugEl = getDebugNode(renderElement);
if (isPresent(debugEl)) {
debugEl.listeners.push(new EventListener(name, callback));
}
return this._delegate.listen(renderElement, name, callback);
}
开发者ID:0oAimZo0,项目名称:Angular2Learning,代码行数:7,代码来源:debug_renderer.ts
示例5: createElement
createElement(parentElement: any, name: string): any {
var nativeEl = this._delegate.createElement(parentElement, name);
var debugEl = new DebugElement(nativeEl, getDebugNode(parentElement));
debugEl.name = name;
indexDebugNode(debugEl);
return nativeEl;
}
开发者ID:0oAimZo0,项目名称:Angular2Learning,代码行数:7,代码来源:debug_renderer.ts
示例6: projectNodes
projectNodes(parentElement: any, nodes: any[]) {
var debugParent = getDebugNode(parentElement);
if (isPresent(debugParent) && debugParent instanceof DebugElement) {
nodes.forEach((node) => { debugParent.addChild(getDebugNode(node)); });
}
return this._delegate.projectNodes(parentElement, nodes);
}
开发者ID:0oAimZo0,项目名称:Angular2Learning,代码行数:7,代码来源:debug_renderer.ts
示例7: setElementAttribute
setElementAttribute(renderElement: any, attributeName: string, attributeValue: string) {
var debugEl = getDebugNode(renderElement);
if (isPresent(debugEl) && debugEl instanceof DebugElement) {
debugEl.attributes.set(attributeName, attributeValue);
}
return this._delegate.setElementAttribute(renderElement, attributeName, attributeValue);
}
开发者ID:0oAimZo0,项目名称:Angular2Learning,代码行数:7,代码来源:debug_renderer.ts
示例8: detachView
detachView(viewRootNodes: any[]) {
viewRootNodes.forEach((node) => {
var debugNode = getDebugNode(node);
if (isPresent(debugNode) && isPresent(debugNode.parent)) {
debugNode.parent.removeChild(debugNode);
}
});
return this._delegate.detachView(viewRootNodes);
}
开发者ID:0oAimZo0,项目名称:Angular2Learning,代码行数:9,代码来源:debug_renderer.ts
示例9: onViewCreated
onViewCreated(view: AppView) {
var viewId = _nextId++;
_allViewsById.set(viewId, view);
_allIdsByView.set(view, viewId);
for (var i = 0; i < view.elementRefs.length; i++) {
var el = view.elementRefs[i];
_setElementId(this._renderer.getNativeElementSync(el), [viewId, i]);
}
}
开发者ID:hankduan,项目名称:angular,代码行数:9,代码来源:debug_element_view_listener.ts
示例10: attachViewAfter
attachViewAfter(node: any, viewRootNodes: any[]) {
var debugNode = getDebugNode(node);
if (isPresent(debugNode)) {
var debugParent = debugNode.parent;
if (viewRootNodes.length > 0 && isPresent(debugParent)) {
var debugViewRootNodes = [];
viewRootNodes.forEach((rootNode) => debugViewRootNodes.push(getDebugNode(rootNode)));
debugParent.insertChildrenAfter(debugNode, debugViewRootNodes);
}
}
return this._delegate.attachViewAfter(node, viewRootNodes);
}
开发者ID:0oAimZo0,项目名称:Angular2Learning,代码行数:12,代码来源:debug_renderer.ts
注:本文中的angular2/src/core/render/api.Renderer类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论