refactor(core): introduce ViewRef
and ProtoViewRef
BREAKING CHANGES: - `NgElement` merged into `ElementRef` - `Compiler.compile…` returns `ProtoViewRef` - `ViewContainer` uses `ProtoViewRef`s and `ViewRef`s. - `ViewRef`/`ProtoViewRef` in renderer were renamed to `RenderViewRef`/`RenderProtoViewRef`. Related to #1477 Closes #1592
This commit is contained in:
3
modules/angular2/src/test_lib/test_bed.js
vendored
3
modules/angular2/src/test_lib/test_bed.js
vendored
@ -9,6 +9,7 @@ import {View} from 'angular2/src/core/annotations/view';
|
||||
|
||||
import {TemplateResolver} from 'angular2/src/core/compiler/template_resolver';
|
||||
import {AppView} from 'angular2/src/core/compiler/view';
|
||||
import {internalView} from 'angular2/src/core/compiler/view_ref';
|
||||
import {DynamicComponentLoader, ComponentRef} from 'angular2/src/core/compiler/dynamic_component_loader';
|
||||
|
||||
import {queryView, viewRootNodes, el} from './utils';
|
||||
@ -103,7 +104,7 @@ export class ViewProxy {
|
||||
|
||||
constructor(componentRef: ComponentRef) {
|
||||
this._componentRef = componentRef;
|
||||
this._view = componentRef.hostView.componentChildViews[0];
|
||||
this._view = internalView(componentRef.hostView).componentChildViews[0];
|
||||
}
|
||||
|
||||
get context(): any {
|
||||
|
@ -276,7 +276,15 @@ export class SpyObject {
|
||||
constructor(type = null) {
|
||||
if (type) {
|
||||
for (var prop in type.prototype) {
|
||||
var m = type.prototype[prop];
|
||||
var m = null;
|
||||
try {
|
||||
m = type.prototype[prop];
|
||||
} catch (e) {
|
||||
// As we are creating spys for abstract classes,
|
||||
// these classes might have getters that throw when they are accessed.
|
||||
// As we are only auto creating spys for methods, this
|
||||
// should not matter.
|
||||
}
|
||||
if (typeof m === 'function') {
|
||||
this.spy(prop);
|
||||
}
|
||||
|
Reference in New Issue
Block a user