diff --git a/lib/core/parser/eval_access.dart b/lib/core/parser/eval_access.dart index 54c7cf64c..23b7ace82 100644 --- a/lib/core/parser/eval_access.dart +++ b/lib/core/parser/eval_access.dart @@ -67,7 +67,7 @@ abstract class AccessReflective { int cachedKind = _cachedKind; if (cachedKind == CACHED_MAP) return holder[name]; var value = _cachedValue; - return (cachedKind == CACHED_FIELD) + return (cachedKind == CACHED_FIELD && value != null) ? value.getField(symbol).reflectee : value; } diff --git a/test/directive/ng_model_spec.dart b/test/directive/ng_model_spec.dart index 656f2671a..fbe3c924f 100644 --- a/test/directive/ng_model_spec.dart +++ b/test/directive/ng_model_spec.dart @@ -7,6 +7,11 @@ main() => describe('ng-model', () { TestBed _; + beforeEach(module((Module module) { + module + ..type(ControllerWithNoLove); + })); + beforeEach(inject((TestBed tb) => _ = tb)); describe('type="text"', () { @@ -584,4 +589,25 @@ describe('ng-model', () { })); }); + describe('error messages', () { + iit('should produce a useful error for bad ng-model expressions', () { + expect(async(() { + _.compile('