forked from angular/angular
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(render): use render layer fully
Introduces angular2/src/core/compiler/ViewFactory which extracts ProtoView.instantiate and replaces ViewPool. Note: This is a work in progress commit to unblock other commits. There will be follow ups to add unit tests, remove TODOs, …
- Loading branch information
Showing
60 changed files
with
1,205 additions
and
3,340 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import {DOM} from 'angular2/src/dom/dom_adapter'; | ||
import {normalizeBlank} from 'angular2/src/facade/lang'; | ||
import * as viewModule from '../compiler/view'; | ||
import {DirectDomViewRef} from 'angular2/src/render/dom/direct_dom_renderer'; | ||
|
||
/** | ||
* Allows direct access to the underlying DOM element. | ||
* | ||
* Attention: NgElement will be replaced by a different concept | ||
* for accessing an element in a way that is compatible with the render layer. | ||
* | ||
* @publicModule angular2/angular2 | ||
*/ | ||
export class NgElement { | ||
_view:viewModule.View; | ||
_boundElementIndex:number; | ||
|
||
constructor(view, boundElementIndex) { | ||
this._view = view; | ||
this._boundElementIndex = boundElementIndex; | ||
} | ||
|
||
// TODO(tbosch): Here we expose the real DOM element. | ||
// We need a more general way to read/write to the DOM element | ||
// via a proper abstraction in the render layer | ||
get domElement() { | ||
var domViewRef:DirectDomViewRef = this._view.render; | ||
return domViewRef.delegate.boundElements[this._boundElementIndex]; | ||
} | ||
|
||
getAttribute(name:string) { | ||
return normalizeBlank(DOM.getAttribute(this.domElement, name)); | ||
} | ||
} |
Oops, something went wrong.