angular-dart

List of AngularDart directives?

守給你的承諾、 提交于 2019-12-03 09:23:43
Is the complete list of AngularDart directives documented somewhere? I understand that this list is subject to change, given the rapid evolution in AngularDart. 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-*] [ng-model][ng-required] [ng-bind-html] [ng-model][pattern] [ng-bind-template] [ng-model][required] [ng

Dart and Client Side File Handling (with authorization)

匆匆过客 提交于 2019-12-02 07:13:30
问题 A server side application requires authorization on file download links. This means a normal <a ng-href="{{createLinkToFile()}}"> is no longer sufficient to get enough parameters passed to the server. When trying to use a programmatic call to the file download, I get the response data back to Dart client application. Using a simple http GET: var url = "http://example.com/file"; headers.putIfAbsent("Authorization", () => "bearer " + token; _http.get(url: url, headers : headers); The future

How to trigger an update of NgComponent when child property changes

只谈情不闲聊 提交于 2019-12-02 04:20:57
I am a complete beginner to AngularDart (and Dart); I followed the tutorials but this is something I can't seem to find a answer to. I have two NgComponents that work perfectly: <colorImage car-color="ctrl.car.color"></colorImage> <carImage car="ctrl.car"></carImage> My controller "ctrl" has a property named "car" and "car" has a property named "color". When "car.color" changes, the colorButton NgComponent updates, but the carImage NgComponent does not. How can I trigger an update of carImage when "car.color" changes? Thanks!! You have to set a watch to car.color inside your CarImage. How this

AngularDart: How do you pass an event from a Child component to a second level parent

牧云@^-^@ 提交于 2019-12-02 03:17:26
I am using StreamControllers with Events, and essentially I have a 3 level component heirarchy lets call them, A,B,C. The heirarchy is A -> B -> C. The origin of the event is in c and i want the event to be processed by A. I know this is rather easy to do with a direct parent -> child relationship using @Output but not sure how to properly handle multiple levels upwards. Thanks for asking. There are a couple ways to do this. (1) Create an event handler in B that forwards from C @Component( selector: 'b', directives: const [C], template: '<c (event)="cDidEvent()"></c>', ) class B { final

how to call a jquery plugin from inside an angular.dart component?

橙三吉。 提交于 2019-12-02 01:41:42
I am learning about angular.dart components by trying to make one that will access an existing jquery plugin. I am trying something like the following: library mylib; import 'dart:html'; // querySelector import 'package:js/js.dart'; // javascript import 'package:angular/angular.dart'; @NgComponent( selector: 'aSelector', templateUrl: 'partial.html', cssUrl: 'style.css', publishAs: 'ctrl', map: const { 'param': '=>param' } ) class myComponent extends NgShadowRootAware { String param; Compiler compiler; Injector injector; Scope scope; MyComponent(this.compiler, this.injector, this.scope); void

Debuging Angular and Polymer dart

我只是一个虾纸丫 提交于 2019-12-01 21:30:23
I asked a question earlier about getting a version of angular and polymer that would play nice with each other. Now I'm having some trouble running it in both dartium and chrome. My code is the same as the in the previous question. When this is done, I'm gonna write up a blogpost on how to get a material design app up and running in dart and update it as they break things. sigh. thanks again for the help Dartium output: warning: file:///packages/polymer/polymer.html not found. warning: file:///packages/paper_elements/paper_tabs.html not found. warning: file:///packages/paper_elements/paper_tab

What is the annotation equivalent of map: const {'foo':'&foo'} in AngularDart?

浪子不回头ぞ 提交于 2019-12-01 20:58:08
I see that this StackOverflow question shows how to bind to a field that contains a function: @NgComponent( selector: 'mycomp', publishAs: 'ctrl', map: const { 'myfunc' :'&myfunc' } ) class MyComponent { Function myfunc; However, it is recommended to use annotations to declare what fields are bound, and how. I see @NgOneWay ( => ) and others, but I don't see an annotation for &myfunc . What annotation should I use? Günter Zöchbauer Ok, just saw you created a new question for this one: For callbacks & use @NgCallback 来源: https://stackoverflow.com/questions/21422866/what-is-the-annotation

Populating derived fields in an Angular Dart component

好久不见. 提交于 2019-12-01 20:26:18
I have a component that takes a single attribute. I want to populate a field in the component with a value that is derived from this attribute. I am running into the problem that the binding with the attribute has not happened when the code inside the constructor runs. How, then, do I set the value of the derived field? Here is some code: import 'package:angular/angular.dart'; @NgComponent( selector: 'tokens', templateUrl: './component.html', cssUrl: './component.css', publishAs: 'ctrl', map: const { 'text' : '@text' } ) class TokensComponent { String text; // Derived field. List<Token> tokens

What means “Observer reaction functions should not change model” using a nested ng-repeat?

馋奶兔 提交于 2019-12-01 19:02:51
问题 Here's a simplified version of the code where I get an error that is logged even if the generated HTML looks good. What does this exception means ? Why do I get it ? index.html : <!DOCTYPE html> <div ng-app main> <div ng-repeat="a in ctrl.listOfA"> <strong>{{ a }}</strong> <div ng-repeat="b in ctrl.listOfB(a)"> {{ b }} </div> </div> </div> <script type="application/dart" src="main.dart"></script> <script src="packages/browser/dart.js"></script> main.dart : import 'package:angular/angular.dart

What means “Observer reaction functions should not change model” using a nested ng-repeat?

好久不见. 提交于 2019-12-01 18:35:54
Here's a simplified version of the code where I get an error that is logged even if the generated HTML looks good. What does this exception means ? Why do I get it ? index.html : <!DOCTYPE html> <div ng-app main> <div ng-repeat="a in ctrl.listOfA"> <strong>{{ a }}</strong> <div ng-repeat="b in ctrl.listOfB(a)"> {{ b }} </div> </div> </div> <script type="application/dart" src="main.dart"></script> <script src="packages/browser/dart.js"></script> main.dart : import 'package:angular/angular.dart'; /* 0.9.10 */ @NgController(selector: '[main]', publishAs: 'ctrl') class MainController { final