refactor(render): cleanup access to native dom elements
BREAKING CHANGES: - rename `ElementRef.domElement` to `ElementRef.nativeElement` - add `Renderer.getNativeElementSync` to make the app side less dependent on the dom renderer. - don’t use `ElementRef.nativeElement` in directives but use the methods on `Renderer` directly. - Removed `ElementRef.setAttribute`. Use `Renderer.setElementAttribute` instead. Closes #2712 Last part of #2476 Closes #2476
This commit is contained in:
@ -46,7 +46,7 @@ export function main() {
|
||||
inject([AsyncTestCompleter], (async) => {
|
||||
var ruler = new Ruler(DOM);
|
||||
var elRef = <any>new SpyElementRef();
|
||||
elRef.domElement = DOM.createElement('div');
|
||||
elRef.nativeElement = DOM.createElement('div');
|
||||
ruler.measure(elRef).then((rect) => {
|
||||
// here we are using an element created in a doc fragment so all the measures will come
|
||||
// back as 0
|
||||
@ -61,7 +61,7 @@ export function main() {
|
||||
@proxy
|
||||
@IMPLEMENTS(ElementRef)
|
||||
class SpyElementRef extends SpyObject {
|
||||
domElement;
|
||||
nativeElement;
|
||||
constructor() { super(ElementRef); }
|
||||
noSuchMethod(m) { return super.noSuchMethod(m) }
|
||||
}
|
||||
|
Reference in New Issue
Block a user