【问题标题】:AngularDart 1.0.0 has issues in IE 11 and Safari 7 and belowAngularDart 1.0.0 在 IE 11 和 Safari 7 及更低版本中存在问题
【发布时间】:2014-12-16 10:55:56
【问题描述】:

在渲染我的页面组件时,我在 Safari 7.0 及更低版本和 IE 11 中遇到了 AngularDart 1.0.0 抛出错误。当试图访问其中一个小部件(它正在循环的变量)时,它似乎在ng-repeat 循环中死了。我的另一个组件(菜单)工作正常。我不太确定我的组件是怎么造成的。错误的摘录是NoSuchMethodError: Cannot call "get$widget" ('undefined' is not a function (evaluating 'o.get$widget()'))

在将 AngularDart 应用程序编译为 JS 后,我没有太多调试经验,但这里是上下文:

closure215: {
    "^": "Closure:14;",
    call$1: [function(o) {
      return o.get$widget();
    }, "call$1", null, 2, 0, null, 86, "call"],
    $isFunction: true
  },

它似乎在大多数其他浏览器上都能完美运行。在升级到 1.0.0 之前,它在 AngularDart 0.14.0 上也能正常工作

这是来自 IE 11 使用源映射的调用堆栈(我不知道 IE 具有该功能):

Anonymous function [Line: 96, Col: 18], main_static_expressions.dart
DirtyCheckingRecord._getter$1 [Line: 398, Col: 3], dirty_checking_change_detector.dart
DirtyCheckingRecord.check$0 [Line: 464, Col: 25], dirty_checking_change_detector.dart
_FieldHandler.acceptValue$1 [Line: 631, Col: 5], watch_group.dart
FieldReadAST.setupWatch$1 [Line: 167, Col: 5], watch_group.dart
FieldReadAST.setupWatch$1 [Line: 158, Col: 5], watch_group.dart
FieldReadAST.setupWatch$1 [Line: 158, Col: 5], watch_group.dart
CollectionAST.setupWatch$1 [Line: 175, Col: 5], watch_group.dart
WatchGroup._addEvalWatch$7 [Line: 233, Col: 25], watch_group.dart
PureFunctionAST.setupWatch$1 [Line: 87, Col: 59], ast.dart
WatchGroup.watch$2 [Line: 140, Col: 3], watch_group.dart
Scope.watchAST$3$canChangeModel [Line: 271, Col: 5], scope.dart
Anonymous function [Line: 38, Col: 9], mustache.dart
NodeAttrs.listenObserverChanges$2 [Line: 79, Col: 5], directive.dart
AttrMustache.AttrMustache$4 [Line: 34, Col: 5], mustache.dart
AttrMustache.static.AttrMustache$ [Line: 28, Col: 3], mustache.dart
Anonymous function [Line: 259, Col: 7], element_binder.dart
ViewFactory._bindTagged$7 [Line: 77, Col: 17], view_factory.dart
ViewFactory._link$4 [Line: 119, Col: 13], view_factory.dart
ViewFactory.call$3 [Line: 58, Col: 5], view_factory.dart
ViewFactory.call$2 [Line: 62, Col: 3], view_factory.dart
Anonymous function [Line: 111, Col: 13], transcluding_component_factory.dart
Anonymous function [Line: 899, Col: 30], zone.dart
_ZoneDelegate.runUnary$3 [Line: 506, Col: 5], zone.dart
VmTurnZone__onRunUnary_closure.call$0 [Line: 122, Col: 43], zone.dart
VmTurnZone._onRunBase$4 [Line: 102, Col: 28], zone.dart
Anonymous function [Line: 121, Col: 39], zone.dart
Anonymous function [Line: 2, Col: 28], Function code (1189)
_CustomZone.runUnary$2 [Line: 801, Col: 5], zone.dart
_Future__propagateToListeners_handleValueCallback.call$0 [Line: 494, Col: 9], future_impl.dart
_Future.static._Future__propagateToListeners [Line: 578, Col: 15], future_impl.dart
_Future.static._Future__propagateMultipleListeners [Line: 431, Col: 7], future_impl.dart
_Future.static._Future__propagateToListeners [Line: 458, Col: 9], future_impl.dart
_Future._completeWithValue$1 [Line: 339, Col: 5], future_impl.dart
Anonymous function [Line: 401, Col: 7], future_impl.dart
Anonymous function [Line: 888, Col: 30], zone.dart
_ZoneDelegate.run$2 [Line: 499, Col: 5], zone.dart
Anonymous function [Line: 127, Col: 30], zone.dart
_FunctionChain.fn$0 [Line: 1181, Col: 42], scope.dart
RootScope._runAsyncFns$0 [Line: 923, Col: 9], scope.dart
Anonymous function [Line: 810, Col: 7], scope.dart
Anonymous function [Line: 315, Col: 7], scope.dart
Anonymous function [Line: 319, Col: 3], scope.dart
Anonymous function [Line: 768, Col: 7], scope.dart
Anonymous function [Line: 890, Col: 14], zone.dart
_ZoneDelegate.run$2 [Line: 499, Col: 5], zone.dart
VmTurnZone._finishTurn$2 [Line: 168, Col: 9], zone.dart
VmTurnZone._onRunBase$4 [Line: 111, Col: 32], zone.dart
Anonymous function [Line: 121, Col: 39], zone.dart
Anonymous function [Line: 2, Col: 28], Function code (1189)
_CustomZone.runUnary$2 [Line: 801, Col: 5], zone.dart
_CustomZone.runUnaryGuarded$2 [Line: 707, Col: 3], zone.dart
Anonymous function [Line: 735, Col: 20], zone.dart
invokeClosure_closure0.call$0 [Line: 1841, Col: 43], js_helper.dart
Anonymous function [Line: 443, Col: 5], isolate_helper.dart
_callInIsolate [Line: 35, Col: 1], isolate_helper.dart
Anonymous function [Line: 1841, Col: 5], js_helper.dart
Anonymous function [Line: 1861, Col: 37], js_helper.dart

【问题讨论】:

    标签: dart angular-dart dart2js


    【解决方案1】:

    我终于想通了,详情在这里:https://github.com/angular/angular.dart/issues/1572

    我猜dart2js 输出的代码是 IE 11 和 Safari 7 在将模板包含在 ng-include 之前尝试自行评估模板。 <template> 所在的位置,其中使用的 ng-repeat 中的一个变量超出了范围,但在 ng-include 所在的范围内。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2011-02-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-09-29
      • 2012-01-24
      • 1970-01-01
      相关资源
      最近更新 更多