1

I'm building an app with Angular Dart. When I'm trying to run it as a javascript it throws an error in the console (Firefox):

"NoSuchMethodError: Cannot call "get$data" (config.get$data is not a function)

or for the same issue in Chrome:

NoSuchMethodError: undefined is not a function

In DevTools I figured that this error is thrown when the app is trying to download component's html file. Error is caused by precompiled javascript code:

closure322: {
  "^": "Closure:139;",
  call$1: function(config) {
    config.get$data(config);
    config.get$data(config);
    return config;
  },
  $isFunction: true
},

I've checked properties of "config" variable and there is no "get$data" function. I'm not sure how to proceed. I've tried pub upgrade and error still exists. There's no error while I'm developing the app in Dartium and there everything works just fine.

Cheers.

4

1 に答える 1

1

私はまったく同じエラーを持っています。次の行に沿って、dart2js のバグだと思います。

https://code.google.com/p/dart/issues/detail?id=18383

私が困惑しているのは、理論的には、私が使用している 1.4.0 で解決されるはずですが、そうではないようです。

angulardart 0.10.0 にダウングレードする必要はありません。0.11 を引き続き使用できますが、チェック モードを無効にする必要があります。これは私の pubspec.yaml の一部です:

    transformers:
    - angular:
        html_files:
        - web/view/home.tpl.html
        - web/view/join.tpl.html
        - web/view/lobby.tpl.html
        - web/view/login.tpl.html
    - $dart2js:
        checked: false
        minify: false
        verbose: false
        analyzeAll: false
        suppressWarnings: false
        suppressHints: false
        terse: false
于 2014-05-27T13:15:47.230 に答える