angular-dart

How can I do a multipart Post in Dart / AngularDart

痴心易碎 提交于 2019-12-01 01:12:38
I've got a REST api which assumes a multipartfile in the a post method. Is there any way to do this kind of posts in Dart / AngularDart because all the solutions I've found so far are not working. I've tried to use the http://dart-gde.github.io/dart-google-oauth2-library/multipart_file/MultipartFile.html solution, but it is not working in the browser because dart.io is not supported there. My question is about the client side part directly from the browser. The serverside, which is written in Java can handle the post. If you need multipart for file upload, all you have to do is send a FormData

Angular2 Dart - Get Text inside Angular2 Component

允我心安 提交于 2019-12-01 00:49:10
I've got an item component which I use inside other components, the item component typically looks like this: <item type="the-type" text="the-text"></item> and is defined like this: @Component( selector: 'item', template: '...') class Item { @Input() String text = "text-goes-here"; @Input() String type = "type-goes-here"; } Now I want to change the item so that it has a more natural feel to it: <item type="the-type">the-text</item> Now I want to get the text the-text from this component. I change the item component to implement AfterContentInit to see if I can somehow capture the text and then

Configuring AngularDart Modules

我只是一个虾纸丫 提交于 2019-12-01 00:23:09
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? pavelgj HttpInterceptors are implemented slightly differently in AngularDart. main() { // define your interceptor var intercept = new HttpInterceptor(); intercept.request = (HttpResponseConfig requestConfig) => /* something */; intercept.response = (HttpResponse response) => /* something */; intercept.requestError = (dynamic error) =>

How can I Dependency Inject based on type and name, with AngularDart?

≯℡__Kan透↙ 提交于 2019-11-30 23:55:29
I have two services, each of which takes a different WebSocket as a constructor parameter. I'd like to use AngularDart's dependency injection to pass in the WebSocket connection, but I can't rely on types alone (as I have two WebSockets). How can I annotate or specify which specific WebSocket connection should to each service? Let's pretend I have: class ServiceOne { WebSocket socketOne; ServiceOne(this.socketOne); } and class ServiceTwo { WebSocket socketTwo; // different connection ServiceTwo(this.socketTwo); } Thanks! This problem is well understood if you look at GUICE. ( https://code

How do I watch elements of an AngularDart collection?

左心房为你撑大大i 提交于 2019-11-30 17:48:44
问题 I have a model: class WordList { List<Word> words = []; } It's created via dependency injection into one of my views. @NgController( selector: '[list-ctrl]', publishAs: 'ctrl' ) class ListCtrl { WordList wordList; Scope scope; ListCtrl(this.router, this.wordList, this.scope) { scope.$watchCollection("", onChange ); } I'd like to run some logic whenever an item is modified from that list. How do I accomplish this? I believe the key is in the $watchCollection, but I can't figure out what to

Does Dart have a widget library?

百般思念 提交于 2019-11-30 11:36:34
Looking into Dart a year later and I don't see any comprehensive widget library. I saw KevMoo's Widget.Dart project on GitHub but none of the widgets actually seem to work. I currently use AngularJS for my projects and have a great set of libraries such as Boostrap UI, and ng-grid which allow me to be productive without recreating the wheel. Anything like this in Dart? There are widget libraries but they are mostly work in progress. for Angular2 Dart angular2-material ng2-strap for Angular.dart 1.x angular.dart.ui a Dart port of Angular UI Polymer AngularPrime-Dart Angular.dart.material for

Why does Angular not need a dash in component name

淺唱寂寞╮ 提交于 2019-11-30 11:20:01
I wondered why Polymer elements need a dash in custom elements name like <my-component> while this is not necessary for Angular components especially as Angular components also use ShadowDOM. ** Edit** It doesn't even seem to be suggested good practice in Angular. ebidel The HTML spec allows you to use unknown tags ( <tab> , <panel> ) without the HTML parser throwing a fit. To their benefit, Angular uses this behavior for their directives to make the components like native. Tags that don't have a - inherit from HTMLUnknownElement . There's a good explanation of the upgrade process here:

AngularDart custom filter call() method required to be idempotent?

丶灬走出姿态 提交于 2019-11-29 23:33:12
问题 The main running example of the Angular Dart tutorial is a Recipe Book app . The exercise at the end of the Chapter 5 on filters and services suggests trying to " create a [custom] filter that will multiply all the amounts [of each ingredient listed] in the recipes " thus allowing a " user to double, triple, or quadruple the recipe ." E.g. an ingredient of "1/2 cup of flour" would become "1 cup of flour" when doubled. I have written such a custom filter: it takes a list of Ingredient s

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

故事扮演 提交于 2019-11-29 21:17:22
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? 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 Angular2. Angular2 is the most recent iteration of Angular and works in Dart. The original answer below

Does Dart have a widget library?

我的未来我决定 提交于 2019-11-29 17:16:11
问题 Looking into Dart a year later and I don't see any comprehensive widget library. I saw KevMoo's Widget.Dart project on GitHub but none of the widgets actually seem to work. I currently use AngularJS for my projects and have a great set of libraries such as Boostrap UI, and ng-grid which allow me to be productive without recreating the wheel. Anything like this in Dart? 回答1: There are widget libraries but they are mostly work in progress. for Angular2 Dart angular2-material ng2-strap for