Comments (9)
Have you tried wrapping it with allowInterop(...)
? (import from package:js
)
I assume you need to do this in Dart code (not in the template).
This seems to be caused by the change from dart:js
to package:js
from angular.
i tried the following:
in dart code:
get getContextMenuItems => allowInterop(addressBookData.getContextMenuItems);
in html:
<data-list
...
[contextMenuItems]="getContextMenuItems"
...
which does not provoke the original exception.
but when i call the closure in my polymer element i get the following exception:
Class 'JsFunction' has no instance method 'call'.
NoSuchMethodError: method not found: 'call'
Receiver: Instance of 'JsFunction'
Arguments: [_LinkedHashMap len:20]
#0 Object._noSuchMethod (dart:core-patch/object_patch.dart:42)
#1 Object.noSuchMethod (dart:core-patch/object_patch.dart:45)
#2 DataList._showMenu (package:direkt_web/widgets/polymer/data_list.dart:300:54)
#3 DataList.selectionHandler (package:direkt_web/widgets/polymer/data_list.dart:281:9)
#4 Function._apply (dart:core-patch/function_patch.dart:7)
#5 Function.apply (dart:core-patch/function_patch.dart:28)
#6 _InstanceMirrorImpl.invoke (package:reflectable/src/reflectable_transformer_based.dart:259:21)
#7 addDeclarationToPrototype.<anonymous closure> (package:polymer/src/common/declarations.dart:134:35)
from angular.
Does this happen in dart2js, Dartium, or both?
from angular.
this one only happens in dartium.
from angular.
@jacob314 I think I saw this problem also when I was working on https://github.com/matanlurey/js-interop-examples (https://github.com/matanlurey/js-interop-examples/blob/master/web/vscode_example.dart#L10). Any insight?
from angular.
@hentoesch can you please fix the code formatting in your comments (wrap code in triple backticks)
Currently all line numbers are treated as references to other issues that also show up as back-reference to this issue there.
from angular.
finally found some time to track down the problem, which still persists in beta 21.
it is working now in dartium, but in chrome after darts2js it still does not work.
dart 1.19, ubuntu 16.04, chrome 53
i have the following constellation:
- from angular i pass a dart object "model" to my polymer element
class Model {
@reflectable
Function callback;
@reflectable
String param;
}
- in my polymer html markup i call a function which gets this object as a parameter
<div>{{callModel(model)}}</div>
which looks like:
@reflectable
callModel(model) {
model.callback(model.param);
}
- after angular 21 the callModel() function gets called, but the parameter "model" in chrome is a JsObject - which does not know anything about a callback.
i built a litlle project to reproduce this bug:
https://github.com/hentoesch/angular_hates_polymer
any ideas?
from angular.
@jacob314 Are we missing something trivial?
from angular.
Closing since we haven't gotten any feedback since September.
from angular.
Related Issues (20)
- DDC issue main method not called HOT 2
- EXCEPTION: Assertion failed: org-dartlang-app:///packages/angular_forms/src/directives/shared.dart:25:7 dir.valueAccessor != null HOT 2
- NgIf initiated by an ComponentFactory thows an error when trying to copy an NgContent
- Dead code fixes tests for component using AsyncPipe
- CSS Invalid output for scientific e notation
- Null-safety in stable HOT 17
- Not sure If I am correct, I also find it hard to understand on how to correctly implements custom value accessor. HOT 1
- Can't work together with grpc-dart-web HOT 5
- Depends on outdated build versions HOT 2
- Api Reference links are broken
- analyzer-0.40.6/lib/src/error/best_practices_verifier.dart:258:50: Error: The property 'displayString' is defined in multiple extensions for 'TargetKind' and neither is more specific. HOT 2
- Application no longer building with Dart 2.14 and cannot update dependencies HOT 5
- Target of URI doesn't exist: 'package:angular/security.dart'
- Thank you! HOT 3
- Angular 7 - Can't bind to 'data-*' since it isn't an input of any bound directive or a native property. HOT 6
- Angular Dart & attribute value should be passed as any value. HOT 3
- Why isn't the ngFactory coupled to the Component's class?
- angular-dart build serve error while running webdev serve HOT 2
- Error on installation of webdev
- where can find the latest document? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from angular.