angular-dart

How to reference child component from its parent in AngularDart

元气小坏坏 提交于 2019-12-11 02:59:01
问题 I have two components: ComponentOne and ComponentTwo . @NgComponent(...) class ComponentOne { } <div> <h1>Component One</h2> <content></content> <div> @NgComponent(...) class ComponentTwo { } <div> <h1>Component Two</h2> <div> Then I have the following markup: <component-one> <component-two></component-two> </component-one> How do I reference ComponentTwo from ComponentOne . To be more specific, I have a method which handles click event and needs to delegate that click event to it's child.

Manual injection in Dart

自闭症网瘾萝莉.ら 提交于 2019-12-11 02:45:21
问题 How do you manually inject an instance in angular dart? This would be the equivalent to the following in angularjs: var myInjector = angular.injector(["ng"]); var $http = myInjector.get("$http"); 回答1: A code example from inside a component. @NgComponent( selector: 'rating', publishAs: 'ctrl') class RatingComponent { Injector _injector; RatingConfig _config; RatingComponent(this._injector) { _config = _injector.get(RatingConfig); // or _config = injectByName("RatingConfig"); } void

Pub get failed, [1] Resolving dependencies… Incompatible version constraints on code_transformers

左心房为你撑大大i 提交于 2019-12-11 02:23:38
问题 Below is my pubspec.yaml file name: MyApp description: A sample command-line application dependencies: csv_sheet: any redstone: any shelf_static: any browser: any angular: ">=0.14.0 <0.15.0" polymer: ">=0.13.0" core_elements: ">=0.2.0+1" paper_elements: ">=0.1.1+2" I am getting the follow error Pub get failed, [1] Resolving dependencies... Incompatible version constraints on code_transformers: - angular 0.14.0 depends on version >=0.1.4+2 <0.2.0 - polymer 0.13.0 depends on version >=0.2.0 <0

Is it possible to use material-select with ngModel/ngControl

纵饮孤独 提交于 2019-12-11 01:59:22
问题 How to use <material-select> with ngModel and ngControl ? Every time I try to use <material-select> with ngModel and ngControl , I get: EXCEPTION: Assertion failed: "No value accessor for (data) or you may be missing formDirectives in your directives list." 来源: https://stackoverflow.com/questions/52630483/is-it-possible-to-use-material-select-with-ngmodel-ngcontrol

Angular Dart: matching rules for route path - implicit suffix wildcard?

限于喜欢 提交于 2019-12-10 21:56:04
问题 Consider (excerpt from the AngularDart tutorial): router.root ..addRoute( name: 'add', path: '/add', enter: view('view/addRecipe.html')) How is a URL matched with such a path? Is there an implicit wildcard suffix like /add/* or maybe /add* ? If so, how can I make /add match exactly /add to avoid conflicts with, say, /address ? 回答1: Correct, UrlTemplate does a naive prefix match, so /add will match /address . If you are worried about conflicts between two routes where path of one happens to be

AngularDart: Creating a Form with Reactive Form Builder

╄→尐↘猪︶ㄣ 提交于 2019-12-10 17:25:34
问题 I'm trying to create from using AngularDart 5 , angular_forms 2 . The API seems to be very different from angular_forms 1 and I cannot figure out how to create a FormGroup using FormBuilder and ControlGroup . Below is my code. LoginComponent.dart import 'dart:convert'; import 'package:angular/angular.dart'; import 'package:angular_forms/angular_forms.dart'; @Component( selector: 'login-comp', templateUrl: 'login_component.html', styleUrls: ['login_component.css'], directives: [formDirectives,

<input type='number'> is auto incrementing. Bug?

北城以北 提交于 2019-12-10 17:22:38
问题 I think I have found a bug concerning the following binding: <input type='number'> when using a controller html: ... {ctrl.i}} ... dart: ... @NgController(...) class AController { int i = 5; } ... When one modifies the input field, then there is an infinite loop (auto increment or auto decrement) Note that this problem does not happen when using no-scope like in: ... <input type="number" ng-model="i"> {{i}} ... Is that a bug? Is there a way to use <input type='number'> ? 回答1: I tried it but

Connecting 2 controllers and have access to the first controllers propertie in the second controller

我们两清 提交于 2019-12-10 16:47:39
问题 i have a problem with angular dart. 1 html file to trigger scopes and 2 controller classes index.html ... {{subCtrl.user.name}} ... first controller @Controller( selector: '[mainController]', publishAs: 'mainCtrl' ) class MainController{ User user = new User('testuser'); MainController(); } second controller @Controller( selector: '[subController]', publishAs: 'subCtrl' ) class SubController{ @NgOneWay('user') User user; // constructor SubController(){ getData(); } void getData(){ if(user !=

Angular dart bookmarking views

旧时模样 提交于 2019-12-10 15:53:34
问题 It is my experience that Angular Dart is agnostic to your backend server implementation. it doesn't care if your server is in java, ruby or whatever. Angular dart has the concept of views and has a module that deals with routing between them. these routes also modify the address bar of the browser when it changes views. I have come across this issue. Though the angular router module will change the address bar, because said route doesn't actually exist as far as the backend server is

How do I get routes to work with AngularDart?

a 夏天 提交于 2019-12-10 13:33:47
问题 This is my code, import 'package:angular/angular.dart'; class AppModule extends Module { AppModule(){ type(AppController); type(LoginController); type(RouteInitializer, implementedBy: AppRouter); } } class AppRouter implements RouteInitializer { init(Router router, ViewFactory view) { router.root ..addRoute( name: 'login', path: '/login', enter: view('app/views/login.tpl.html')) ..addRoute( defaultRoute: true, name: 'index', enter: view('app/views/index.tpl.html')); } } @NgController(selector