angular-dart

angular.dart seems to be slow

假装没事ソ 提交于 2019-12-10 11:54:09
问题 I am trying angular.dart and saw that its slow. When am html page is loaded containing angular, angular directive is seen first, which are then converted appropriately. Shouldn't it be converted instantaneously and the user should not see whether we are using angular ? <!DOCTYPE html> <html ng-app> <head> <title>Hello, World!</title> </head> <body> <h3>Hello {{name}}!</h3> name: <input type="text" ng-model="name"> <script type="application/dart" src="main.dart"></script> <script type="text

How to assign default values for routing parameters in angular.dart?

折月煮酒 提交于 2019-12-10 11:44:54
问题 Consider the following route config: route ..addRoute( name: 'custom', defaultRoute: true, path: '/:param1/:param2', enter: view('view/template.html') ); I am injecting the router into a controller and setting up router.onRouteStart.listen , within which I am accessing parameters via router.activePath.last.parameters , now, if param2 is not present in the user entered route, then i want to assign a default value to param2 (also replace the route). How do I go about it? 回答1: After a bit more

In Dart Angular, how to pass functions to component

我怕爱的太早我们不能终老 提交于 2019-12-10 04:33:38
问题 I have a component MyComp and I would like to pass a function to it as parameter. More precisely I would like to do something like that: dart component file: @NgComponent( selector: 'mycomp', publishAs: 'ctrl', map: const { 'myfunc' :'=> myfunc' } ) class MyComponent { Function myfunc; .... myfunc(); } html: <mycomp myfunc="ctrl.myfunc"></button-list> The problem is that myfunc is null in the component. Do I miss something? How can I do that? 回答1: Use '&' to bind a function to a field:

angular.dart seems to be slow

孤街浪徒 提交于 2019-12-09 08:15:29
I am trying angular.dart and saw that its slow. When am html page is loaded containing angular, angular directive is seen first, which are then converted appropriately. Shouldn't it be converted instantaneously and the user should not see whether we are using angular ? <!DOCTYPE html> <html ng-app> <head> <title>Hello, World!</title> </head> <body> <h3>Hello {{name}}!</h3> name: <input type="text" ng-model="name"> <script type="application/dart" src="main.dart"></script> <script type="text/javascript" src="packages/browser/dart.js"></script> </body> </html> Amit Developer Surround {{name}}

List of AngularDart directives?

时光总嘲笑我的痴心妄想 提交于 2019-12-09 06:40:09
问题 Is the complete list of AngularDart directives documented somewhere? I understand that this list is subject to change, given the rapid evolution in AngularDart. 回答1: Here is what I have found: The classes implementing the directives are listed in the angular.directive library API documentation page. The list of event directives can be found in the angular.directive/NgEventDirective class Dartdoc. Here is the list of (non-event) directives extracted from the source as of 2014-02-02: [ng-attr-*

How can I do a multipart Post in Dart / AngularDart

天大地大妈咪最大 提交于 2019-12-09 02:02:32
问题 I've got a REST api which assumes a multipartfile in the a post method. Is there any way to do this kind of posts in Dart / AngularDart because all the solutions I've found so far are not working. I've tried to use the http://dart-gde.github.io/dart-google-oauth2-library/multipart_file/MultipartFile.html solution, but it is not working in the browser because dart.io is not supported there. My question is about the client side part directly from the browser. The serverside, which is written in

EventEmitter is deprecated and shouldn't be used

此生再无相见时 提交于 2019-12-08 20:56:01
问题 In AngularDart 3.0.0 EventEmitter is deprecated. So, how to send event from child component to parent? Before update it is looks like: @Component( selector: 'my-test', templateUrl: 'test.component.html' ) class TestComponent { @Input() String name = ''; @Output() EventEmitter<String> onNameChange = new EventEmitter<String>(); } ... onNameChange.emit('New Name'); ... Now I need use Stream and StreamController. Can someone give an example? 回答1: Just use a normal StreamController final

Now that Controller is deprecated, what do I use instead?

本秂侑毒 提交于 2019-12-08 19:06:48
问题 I have two top level controllers, and now that Controller is deprecated, I'm wondering how to convert them to whatever it is they need to be. 回答1: In the answer of a similar question it was already mentioned that even though Controller is already deprecated there is no replacement yet but will be before 1.0. As far as I read from recent issue updates Template is planned to become the replacement for Controller and Decorator / Directive . I haven't checked but I think it is not yet shipped in

Is there a PDF viewer to be used in a DART/Angulardart Chrome Packaged App ?

馋奶兔 提交于 2019-12-08 14:15:27
问题 I am trying to find a suitable PDF viewer to simply display PDF URLs ( external ) / or files ( after creating blobs to the external URLs) in my Chrome packaged app. Tried various things , webview/sandbox pages and using pdf.js. but no luck so far. I am able to get the PDF show up with the webview for the first time but not able to dynamically change the webview's src; as I believe there is an issue with that. Is there anyone displaying dynamic external PDF URLs in a chrome packaged app / how

How to query the shadowDOM in an Angular component test

丶灬走出姿态 提交于 2019-12-08 07:43:04
问题 I have this unit-test setup and want to examine the shadowDOM of the <rating> element. But the shadowDOM has no childNodes. In the code below I try to examine the elements shadowDOM in the getStars() method. Is there a flaw in my approach? Should this work? library bootstrap_angular.test.elements.rating; import 'dart:html' as dom; import 'dart:async'; import 'package:unittest/unittest.dart'; import 'package:unittest/html_enhanced_config.dart'; import 'package:angular/angular.dart' as ng;