angular-dart

how to write a simple http intercept?

∥☆過路亽.° 提交于 2019-12-25 05:09:59
问题 Can somebody explain what is wrong with the following? void main() { var intercept = new HttpInterceptor(); intercept.response = (HttpResponse response) => print('we have a response'); Injector injector = ngBootstrap(module: new MyModule()); var interceptors = injector.get(HttpInterceptors); interceptors.add(intercept); } Thanks in advance EDIT: And here is how I do an http request (from inside a directive): @NgDirective( selector: '.my-selector') class MyDirective implements NgAttachAware {

Dependent <material-dropdown-select>

北城以北 提交于 2019-12-25 04:16:32
问题 I want to link multiple <material-dropdown-select> , using [(ngModel)] + (ngModelChange) , making them dependent. (So not by using *ngFor + <material-select-item> .) But I do not find how to make these <material-dropdown-select> dependent, such that when the "parent" is updated, the "first child" is updated/reset, and then when the first child is selected, the second is reset/updated, and so on. I tried with querySelector() but obviously, this is not the good way. Maybe with ViewChild /

NgComponent ready event

*爱你&永不变心* 提交于 2019-12-24 23:14:31
问题 I am trying to create a NgComponent which is populated with elements when the component is loaded. How do I know when the component is populated with the template? Here is some of my code: class SleepTimeModule extends Module { SleepTimeModule() { //... type(SleepGraph); //... } } //... @NgComponent( selector: 'sleep-graph', publishAs: 'sleepGraph', template: '<div><svg></svg></div>' ) class SleepGraph { Element element; Scope scope; @NgTwoWay('data') var data; SleepGraph(this.element, this

material Design with Angular Dart and Polymer dart. Compilation issues

喜夏-厌秋 提交于 2019-12-24 16:27:37
问题 I am at my whits end here. I've been trying over the last 48 hours to get these technologies to work.I've read everywhere that they should be able to work but it's just one problem after the other. I've tried various combinations of my pubspeck.yaml file but the results I get are either the code simply wont build, or it just doesn't work >.> I'll appreciate any help I can get! my pubspeck.yaml: name: blah dependencies: angular: 0.12.0 angular_node_bind: any shadow_dom: any browser: any

angular.dart - Relative URL resolution requires a valid base URI

允我心安 提交于 2019-12-24 13:18:09
问题 This is a question for those of you who were able to build a working Phonegap app from a Dart app that uses angular.dart v1.1.0 I made a very simple Dart app. It has only a "web" directory containing three files: index.html, main.dart and config.xml for Phonegap. The index.html contains at the end of body tag: <script type="application/dart" src="main.dart"></script> <script data-pub-inline src="packages/browser/dart.js"></script> The main.dart contains: import 'dart:html'; import 'package

What is the standard way to send messages between NgController and NgComponent in AngularDart?

这一生的挚爱 提交于 2019-12-24 12:49:15
问题 I have a controller that needs to get some info from a component. Each are getting created by angular through the dom. I understand that components update the models that are given to them which can be provided by the controller. What is the angular way to notify the controller about those changes in the component? 回答1: To say that you want a controller to be notified about a change from a component isn't really the correct way to think about what is going on. In the controller, some type of

Angular Dart: Data binding doesn't work when manipulating the controller from the outside

随声附和 提交于 2019-12-24 10:46:46
问题 I have two controllers nested into each other. The outer controller shows/hides the inner controller by using an ng-switch directive. The outer controller also contains a checkbox. If this checkbox gets checked then the inner controller is made visible (via the above ng-switch directive). This checkbox works as intended. There's also an "open" link outside the controllers. Its onclick handler calls into the outer controller and is supposed to check the checkbox via the model. The problem is

With List of objects how can the `filter` filter know which fields to match on?

风格不统一 提交于 2019-12-24 07:22:08
问题 I was using filter:query on a json response to filter. Everything worked fine. When I turned the json response into proper classes the filter stopped working. What is the approach to use query to match fields on a class? Is this the situation where I should then create my own custom @NgFilter? 回答1: For the AngularDart filter filter you specify which fields to match on by passing the field names as the keys to a map . Let us use the AngularDart tutorial Recipe class as an example: class Recipe

Upgraded to AngularDart 0.13.0 and getting errors about routing and di

最后都变了- 提交于 2019-12-24 05:04:20
问题 I upgraded to AngularDart 0.13.0 and I am receiving the errors below. What is the correct way to initialize the RoutingModule with the new di package 2.0.1? In main.dart I have: class RoutingModule extends Module { RoutingModule() { bind(RouteInitializerFn, toValue: myRouteInitializer); bind(NgRoutingUsePushState, toFactory: (_) => new NgRoutingUsePushState.value(false)); } } Let me know if you think any other Modules would be relevant. The rest are just simple bind(Component); statements. I

Use DartAngular with dart:html

China☆狼群 提交于 2019-12-24 01:57:32
问题 Is it possible to use default dart library html with angular dart? ie: class Test1Component implements OnInit{ @override void ngOnInit() { ButtonElement button = querySelector('button'); //Broken code, avoid button to be null. button.onClick.listen(onClick); } void onClick(Event e){ print('Button clicked'); } } How can I avoid to get a 'null' button without the using any timers? Basically I'm using only angular just for the Routes and but I'd like to stick with dart:html to control the DOM