angular-dart

Angular2 dynamic change CSS property

血红的双手。 提交于 2019-12-17 08:35:24
问题 We are making an Angular2 application and we want to be able to somehow create a global CSS variable (and update the properties' values whenever changed when the variable is assigned). We had used Polymer for a while (now we are switching to Angular2 components) and we had used CSS properties (Polymer has some polyfill) and we had just update styles using Polymer.updateStyles() . Is there any way how we can achieve a similar function? EDIT: We want something similar to Sass color: $g-main

Wait for dom ready without useShadowDom

前提是你 提交于 2019-12-14 04:04:06
问题 I want to wait until my component is fully loaded. The current approach would be to implement the ShadowRootAware interface. However this does not work, if the component disables the use of shadow dom: @Component( selector: 'travel-step', templateUrl: 'packages/TravelPlanner/travelstep/travel_step_component.html', useShadowDom: false, publishAs: 'cmp') class TravelStepComponent extends AttachAware{ I need to disable the usage of ShadowDom, because I want to use styles from my parent object (e

“Angular 2 could not understand the value in View#template” using $event

青春壹個敷衍的年華 提交于 2019-12-14 02:22:42
问题 I can't get $event working. Example: import 'package:angular2/core.dart'; @Component( selector: 'my-app', template: ''' <h1>{{title}}</h1> <button (click)="onTest($event)">testing</button> ''') class AppComponent { String title = 'Testing event'; onTest(event) { print(event); } } When I let pub serve the app, I throws a build error: Build error: Transform DirectiveProcessor on file_transfer|lib/app_component.dart threw error: Angular 2 could not understand the value in View#template. ''' <h1>

Angular Dart - execute a function right after ng-repeat has finished

不打扰是莪最后的温柔 提交于 2019-12-13 19:42:56
问题 Searching stackoverflow for this question always give me the solution for Angular.js. How would you do this in Anuglar dart? That is I want to have a function run after an ng-repeat directive in angular dart has finished rendering its elements. EDIT: It turns out that knowing when ng-repeat has finished enumerating doesn't means the appropriate dom element has being attached to the document. I guess my intended question was how to determine when all elements enumerated by ng-repeat is

Repeat over elements provided as content

≡放荡痞女 提交于 2019-12-13 19:13:57
问题 When I create a component in Angular.dart like library main; import 'package:angular/angular.dart'; import 'package:di/di.dart'; class Item { String name; Item(this.name); } @NgComponent( selector: 'my-component', publishAs: 'ctrl', applyAuthorStyles: true, template: '''<div ng-repeat="value in ctrl.values"><span>{{value.name}}</span> - <content><content></div>''' ) class MyComponent { List<Item> values = [new Item('1'), new Item('2'), new Item('3'), new Item('4')]; MyComponent() { print(

Module.DEFAULT_REFLECTOR not initialized

心不动则不痛 提交于 2019-12-13 18:26:09
问题 I'm setting up an AngularDart/PolymerDart project, but I keep running against the following error: Breaking on exception: Module.DEFAULT_REFLECTOR not initialized for dependency injection. http://goo.gl/XFXx9G Now I've read the page behind the url given at the end of the error and did some Stackoverflowing, but the only sollution I came across was adding -angular as a transformer in the pubspect.yaml. And so I did. But still I keep getting the same error and my project won't start. My pubspec

What is right way to use select directive in angular.dart

断了今生、忘了曾经 提交于 2019-12-13 04:39:39
问题 I extend angular.dart.tutorial with basic CRUD operations. So in new edit_recipe_component.html I need to add some sort of selection input for recipe categories. Currently I have <select ng-model="ctrl.recipe.category"> <option ng-repeat="c in ctrl.categories" value="{{c}}">{{c}}</option></select> That works perfectly well on the surface: I can select category from the list, selected category is successfully stored in model and so on. But I get these errors in debug console: NoSuchMethodError

How do I change the color and width of material drawer component in angular-dart in css?

廉价感情. 提交于 2019-12-13 03:34:50
问题 My first question ever - so apologies if I am not specific enough. How do I change the color and width of material drawer component in angular-dart in css? I have tried it several ways in the CSS, including as below: ::ng-deep material-drawer { color: #9437FF; width: 200px; } .material-drawer { color: #9437FF; width: 200px; } FYI, the following worked with the material-header, which is inside a header tag: ::ng-deep header.material-header.material-header { background-color: white; color:

How do you fix upgrade

♀尐吖头ヾ 提交于 2019-12-12 23:24:32
问题 I'm 3 months new into dart and I've been fairly lucky not to have encountered any issues that couldn't be fixed from answers found on the net, but this one has stumped me. I downloaded this sample app (https://github.com/vsavkin/angulardart-sample-app) installed it into dart-editor (on my mac mini) using Open Existing Folder and then running get Pub Get (or even Pub Update) on the pubspec.yaml file. I was getting dartium loading with a running app until I upgraded the SDK from 1.4.2 to 1.5.8

Fine-grained error messages in Angular Dart forms

 ̄綄美尐妖づ 提交于 2019-12-12 18:33:04
问题 I have the following form with some simple validation rules: <form name="signup_form" novalidate ng-submit="ctrl.signupForm()"> <div class="row"> <input placeholder="Username" name="username" ng-model="ctrl.username" required ng-minLength=3 ng-maxLength=8> </div> <div ng-show="signup_form['username'].dirty && signup_form['username'].invalid"> <!-- ... --> </div> <button type="submit">Submit</button> </form> I would like to display specific error messages for required , ng-minLength and ng