angular-dart

Angular Dart component events

旧街凉风 提交于 2019-11-29 11:52:57
I am trying to pass custom events from a component to its parent component/controller confirm.html <div class="comfirm-component"> <content></content> <a href="#" ng-click="ctrl.yes()">Yes</a> <a href="#" ng-click="ctrl.no()">No</a> </div> confirm.dart @Component( selector: "confirm-component", templateUrl: 'confirm.html', useShadowDom: false, publishAs: "ctrl" ) class ConfirmComponent { void yes(){ print('yes'); // Fire confirm-yes event } void no(){ print('no'); // Fire confirm-no event } } is there something like this?: <confirm-component on-confirm-yes="doSomething()" on-confirm-no=

ng-repeat not working over collections that contains dupes

旧巷老猫 提交于 2019-11-29 09:19:53
The following code is not working because the collection contains dupes: <div ng-repeat="value in [4, 4]"></div> I think that the following should work but is unfortunately not working: <div ng-repeat="value in [4, 4] track by $index"></div> Is that a bug? Is there a way to use ng-repeat over a collection that contains dupes? Thanks in advance, Olivier Kia Panahi Rad This feature has been added to AngularJS in newer versions. the point is that basically you should not iterate over some primitive types (e.g. numbers) but over some complex objects. from what I've understood the ngRepeat

Use SCSS style files within AngularDart 5 and Dart 2

北城以北 提交于 2019-11-29 07:06:06
I’m working with Dart 2 and AngularDart 5 . ⚠ I searched online about my question, but I didn’t find a satisfactory answer. ❔ Can somebody explain all the steps I need to include and to work with SCSS style files within my AngularDart application? I started with quickstart application that you can find here . Thank you! Add a dev dependency to your pubspec.yaml for sass_builder: ^2.0.0 . Run pub get to download the new dependencies. Create a sass file ex: lib/app_component.scss and add some styles to it. Add a the compiled css stylesheet to your the @Component annotation in lib/app_component

What is the equivalent annotation for the old map/@attr in AngularDart?

一个人想着一个人 提交于 2019-11-29 04:55:39
The AngularDart tutorial (at of the time of this writing), recommends binding component fields to attributes like this: map: const { 'max-rating' : '@maxRating', 'rating' : '<=>rating' } However, I see also that Angular has @NgOneWay , @NgTwoWay , and others. I can't find the annotation for @ . Which annotation do I want if I want the same semantics as @maxRating ? Apparently: @NgOneWay == => @NgTwoWay == <=> @NgOneWayOneTime == =>! ??? == @ Günter Zöchbauer I think @NgAttr is what you are looking for. For callbacks there is also @NgCallback == & - just to complete your list. 来源: https:/

Differences between Angular.js and Angular.dart? [closed]

拜拜、爱过 提交于 2019-11-28 16:56:21
问题 I know a bit about Angular.js, but I want to teach myself Dart and Angular.dart now. I'm a bit curious what the differences between the two are, though. The Angular.dart tutorial specifically says it won't compare the two. Does anyone who has used both have a perspective on what the differences are? 回答1: Update #2 (Aug '16) A Dart version of Angular is now maintained by the Dart team on Github: dart/angular2 on github Update : The AngularDart project is mothballed and has been superseded by

loading google map in angular.dart view (ng-view)

只谈情不闲聊 提交于 2019-11-28 14:18:50
I am trying to create a single page app in angular.dart with multiple views , but I cant find a working example of loading up a Google Map in a view being routed into. I am using the google_maps package. It works out fine when the div element to contain the map is defined in the main index.html page, but an exception is thrown when the map div is defined in the view: 'TypeError: Cannot read property 'offsetWidth' of null' I suppose this means the view has not been rendered by the time the directive class is loading. How should one load a Map in a view? Here is the router: @InjectableService()

Why is Controller deprecated in AngularDart 0.10.0?

倖福魔咒の 提交于 2019-11-28 11:11:49
I just upgraded to AngularDart 0.10, renamed my Ngcontrollers to Controller and I am very surprised to see that Controller is marked as deprecated by dart-editor. I have seen that Controller is supposed to disappear in AngularDart 1.0 [1] but why is it already deprecated? Am I supposed to use something else right now? [1] http://blog.angulardart.org/2014/04/angulardart-0100-ostemad-teleportation.html I haven't really understood this change myself but some information: https://github.com/angular/angular.dart/issues/919 It seems there is only a top level controller left and otherwise component

Angular Dart component events

与世无争的帅哥 提交于 2019-11-28 05:39:13
问题 I am trying to pass custom events from a component to its parent component/controller confirm.html <div class="comfirm-component"> <content></content> <a href="#" ng-click="ctrl.yes()">Yes</a> <a href="#" ng-click="ctrl.no()">No</a> </div> confirm.dart @Component( selector: "confirm-component", templateUrl: 'confirm.html', useShadowDom: false, publishAs: "ctrl" ) class ConfirmComponent { void yes(){ print('yes'); // Fire confirm-yes event } void no(){ print('no'); // Fire confirm-no event } }

ng-repeat not working over collections that contains dupes

自闭症网瘾萝莉.ら 提交于 2019-11-28 02:45:22
问题 The following code is not working because the collection contains dupes: <div ng-repeat="value in [4, 4]"></div> I think that the following should work but is unfortunately not working: <div ng-repeat="value in [4, 4] track by $index"></div> Is that a bug? Is there a way to use ng-repeat over a collection that contains dupes? Thanks in advance, Olivier 回答1: This feature has been added to AngularJS in newer versions. the point is that basically you should not iterate over some primitive types

Configuring AngularDart Modules

一笑奈何 提交于 2019-11-28 02:15:32
问题 I'm trying to add an HttpInterceptor. In AngularJS I would write something like this: m.config(["$httpProvider", function($httpProvider) {...}]) But it seems like there is no config function in AngularDart. What is the right way to configure AngularDart modules? 回答1: HttpInterceptors are implemented slightly differently in AngularDart. main() { // define your interceptor var intercept = new HttpInterceptor(); intercept.request = (HttpResponseConfig requestConfig) => /* something */; intercept