angular-dart

AngularDart: “logical pages” and views are 1-to-1 or 1-to-many or what?

雨燕双飞 提交于 2019-12-08 07:05:08
问题 What is the relationship between an app's " logical pages " and views in AngularDart (or JS)? For example, in the context of the AngularDart tutorial Recipe Book example, I originally considered "view recipe" and "edit recipe" as logical pages (or as an app steady state as @pavelgj suggests). When I started working through the AngularDart tutorial I thought that a logical pages and Angular "views" were in one-to-one correspondence. But in Chapter 6, views are treated as part of a the index

How to specify dependency_overrides in pubspec.yaml?

∥☆過路亽.° 提交于 2019-12-08 06:45:40
问题 I am working with latest version of angular.dart and my pubspec.yaml looks somewhat like this: name: angularApp dependencies: angular: git: 'git@github.com:angular/angular.dart' third_party_angular_plugin: any the problem is third_party_angular_plugin is depending on stable version of angular.dart . I tried to specify as follows: name: angularApp dependencies: angular: git: 'git@github.com:angular/angular.dart' third_party_angular_plugin: any dependency_overrides: angular: version: ">=0.9.10"

Factory injection in Angular-Dart DI library

本秂侑毒 提交于 2019-12-08 06:33:26
问题 In my Dart application I'm using the MVP pattern and the angular-dart Dependency Injection library(angular-di). In the example above, I cannot inject MyView or MyPresenter, as this is a circular dependency. class MyView { MyPresenter presenter; MyView(this.presenter); } class MyPresenter { MyView view; MyPresenter(this.view); } The way I usually did this in Java with Guice was injecting a Factory, like: class MyView { MyPresenter presenter; MyView(this.presenter); } class MyPresenter {

Object binding between Angular and Polymer in Dart

邮差的信 提交于 2019-12-08 04:57:01
问题 I'm trying to bind an object from an Angular controlled element to a Polymer element in Dart. The object to bind: class Person { String name; String surname; Person(this.name, this.surname); } The polymer element template: <link rel="import" href="packages/polymer/polymer.html"> <polymer-element name="person-element"> <template> <style> .label {font-weight: bold;} </style> <p> <span class="label">Name: </span>{{person.name}} <span class="label">Surname: </span>{{person.surname}} </p> <

AngularDart 5 and Firebase deployment

陌路散爱 提交于 2019-12-08 04:32:51
问题 I’m trying to deploy my AngularDart 5 web app to Firebase. These are the steps I followed: I builded my app with the command pub run build_runner build --output build . I launched the command firebase init and setted web folder as the public folder. I deployed my web app with the command firebase deploy . ⚠ The problem is that when I open the website I find only a blank page . ❔ What I’m doing wrong? Thank you! Yes, I am still having this issue. The content of my firebase.json is: { "hosting"

How does AngularDart dependency injection work?

孤街浪徒 提交于 2019-12-07 17:03:57
问题 I have an component that needs to access its root element from the Dart code. By reading Differences between Angular.js and Angular.dart? here on SO and grepping around in the AngularDart source code I figured out that what I need is to provide a constructor with explicitly typed arguments. If one of the arguments has type dom.Element , it will be given the reference to my components root by the Angular injector. (Failing to have types on the constructor arguments results in an exception

How do I use AngularDart when my static files are on a CDN with a varying URL?

孤街醉人 提交于 2019-12-07 07:13:05
问题 I'm using AngularDart for a new application of mine. I have a component set up like so: @NgComponent( selector: 'game-timeline', templateUrl: '/static/dart/game/web/views/timelineview.html', cssUrl: '/static/dart/game/web/views/timelineview.css', publishAs: 'ctrl' ) But my problem is, the template and css locations aren't necessarily known at build-time. They'll be on a CDN with a unique deploy-identifier on them. Something like... http://cdn.domain.com/static/30294832098/dart/game/web/views

Other way that type() in angular dart

和自甴很熟 提交于 2019-12-07 04:00:48
问题 I did the angular dart tutorial and I have a question about it. To declare a type available for dependecy injection, I have to do this: class MyAppModule extends Module { MyAppModule() { type(RecipeBookController); } } And so on for all types. In a big app, you can have hundreds type, so it's a weird way to declare all types. Is there any other way to do this? Thanks. 回答1: You can use reflection to collect the types. Please add a comment if you need more information about this approach (I try

AngularDart v0.14.0 Error: Type 'xxx' not found in generated typeFactory maps when run pub server

匆匆过客 提交于 2019-12-06 13:17:24
I test my app on AngularDart v0.14.0 pub server but it has error Exception: Uncaught Error: Type 'CurrencyService' not found in generated typeFactory maps. Is the type's constructor injectable and annotated for injection? Stack Trace: #0 GeneratedTypeFactories.parameterKeysFor (package:di/src/reflector_static.dart:26:5) #1 Binding.bind (package:di/src/module.dart:61:49) #2 Module.bindByKey (package:di/src/module.dart:136:17) #3 Module.bind (package:di/src/module.dart:124:14) #4 CERPModule.CERPModule (http://localhost:8080/index.dart:71:9) #5 main.<anonymous closure> (http://localhost:8080

AngularDart NgComponent using event listeners in the controller

扶醉桌前 提交于 2019-12-06 12:42:25
I have an NgComponent in Angular Dart which instantiates a search box and according to the query strings it populates another div in my html template with the ng-repeat directive. More precisely, Query string update: there is a binding to the input text value with a field in my components' controller. Results population: In the attach() method I added a watcher for the local field which acts as a model to the input box, and whenever it changes I add to a local list some items which then acts as a model to the ng-repeat directive in another div. So far everything works fine. But now I want to