Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

implement ServerDomRenderer #67

Merged
merged 6 commits into from Aug 8, 2015
Merged
Prev

refactor(ServerDomRenderer): use DOM.nodeName

  • Loading branch information
PatrickJS committed Aug 8, 2015
commit c1ae43648c2150db341c24a3715d0e2bb0353062
@@ -11,7 +11,7 @@ import {EventManager} from 'angular2/src/render/dom/events/event_manager';
import {DomSharedStylesHost} from 'angular2/src/render/dom/view/shared_styles_host';
import {TemplateCloner} from 'angular2/src/render/dom/template_cloner';
import {resolveInternalDomView} from 'angular2/src/render/dom/view/view';

import {DOM} from 'angular2/src/dom/dom_adapter';
import {bind, Injectable, Inject} from 'angular2/di';

@Injectable()
@@ -29,7 +29,8 @@ export class ServerDomRenderer extends DomRenderer {
setElementProperty(location: RenderElementRef, propertyName: string, propertyValue: any) {
if (propertyName === 'value' || propertyName === 'checked') {
var view = resolveInternalDomView(location.renderView);
if (view.boundElements[location.renderBoundElementIndex].name === 'input') {
var element = view.boundElements[location.renderBoundElementIndex];
if (DOM.nodeName(element) === 'input') {
view.setElementAttribute(location.renderBoundElementIndex, propertyName, propertyValue);
return;
}
@@ -40,7 +41,8 @@ export class ServerDomRenderer extends DomRenderer {
invokeElementMethod(location: RenderElementRef, methodName: string, args: List<any>) {
if (methodName === 'focus') {
var view = resolveInternalDomView(location.renderView);
if (view.boundElements[location.renderBoundElementIndex].name === 'input') {
var element = view.boundElements[location.renderBoundElementIndex];
if (DOM.nodeName(element) === 'input') {
view.setElementAttribute(location.renderBoundElementIndex, 'autofocus', null);
return;
}
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.