angular-dart

angular.dart how to create a custom component programmatically and add to page?

眉间皱痕 提交于 2019-12-22 15:49:12
问题 Is it possible to define an angular-dart component and then programmatically create an instance of that component and add it to your web page? I'd hoped there might be something like: import 'package:web_sandbox/web_sandbox.dart'; import 'package:angular/angular.dart' as ng; void main() { document.body.appendHtml('<web-sandbox-component></web-sandbox-component>'); var node = document.body.query('web-sandbox-component'); ng.compile(node); } is there away of creating an angular web component

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

假装没事ソ 提交于 2019-12-22 13:56:35
问题 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

AngularDart ng-change

徘徊边缘 提交于 2019-12-22 10:00:05
问题 I have html: <select ng-model="main.selectedReport" ng-change="main.selectReport()"> <option value="">Not selected</option> <option ng-repeat="rep in main.reports" value="{{rep.value1}}">{{rep.value2}}</option> </select> My controller is: @NgController(selector: '[main-controller]', publishAs: 'main') class MainController extends FCViewAbstractController { Map reports; Long selectedReport; .... selectReport() { print(selectedReport); } } My question is why do I get previous selected value in

Ng-click No getter for 'clickHandler' in AngularDart

可紊 提交于 2019-12-22 06:16:13
问题 Trying to get a simple click handler working, and it's proving to be quite frustrating. The application is just a test application to try out different Angular.Dart features. - Using Dart 1.6 and Angular 1.0 and running in Dartium - Clicking the button throws the error. Ng-click No getter for 'clickMe'. But data binding on the input and label works perfectly fine. Sample code import 'package:angular/angular.dart'; import 'package:angular/application_factory.dart'; class TestMod extends Module

Verifying route preconditions prior to loading controller

China☆狼群 提交于 2019-12-21 04:22:34
问题 I'm writing a single page application in Angular, specifically angular.dart, but I'm assuming this question still applies to AngularJS. Take for example the following routes: /login - Expects nobody to be logged in. If someone is authenticated but not registered, redirect to "register" route, if they are registered, redirect to the "home" route. /register - Expects an authenticated user who hasn't finished the registration process. If not authenticated, redirect to login. If is authenticated,

How to trigger an update of NgComponent when child property changes

一笑奈何 提交于 2019-12-20 04:19:06
问题 I am a complete beginner to AngularDart (and Dart); I followed the tutorials but this is something I can't seem to find a answer to. I have two NgComponents that work perfectly: <colorImage car-color="ctrl.car.color"></colorImage> <carImage car="ctrl.car"></carImage> My controller "ctrl" has a property named "car" and "car" has a property named "color". When "car.color" changes, the colorButton NgComponent updates, but the carImage NgComponent does not. How can I trigger an update of carImage

How to trigger an update of NgComponent when child property changes

随声附和 提交于 2019-12-20 04:18:50
问题 I am a complete beginner to AngularDart (and Dart); I followed the tutorials but this is something I can't seem to find a answer to. I have two NgComponents that work perfectly: <colorImage car-color="ctrl.car.color"></colorImage> <carImage car="ctrl.car"></carImage> My controller "ctrl" has a property named "car" and "car" has a property named "color". When "car.color" changes, the colorButton NgComponent updates, but the carImage NgComponent does not. How can I trigger an update of carImage

How to scrollTop a div whose content is managed by AngularDart?

旧城冷巷雨未停 提交于 2019-12-20 03:06:43
问题 I have a div holding some chat history. I would like for the div content to scroll when it becomes full. I have this working using jQuery in another project, but what would be the proper AngularDart way to achieve this? Simplifying a bit, in my HTML I have <div class="chatHistory">{{ctrl.text}}</div> (using style white-space:pre ) and in my controller I have the method void addToChatHistory(String msg) { text += msg; var elt = querySelector(".chatHistory"); elt.scrollTop = elt.scrollHeight; }

how to call a jquery plugin from inside an angular.dart component?

感情迁移 提交于 2019-12-20 02:52:41
问题 I am learning about angular.dart components by trying to make one that will access an existing jquery plugin. I am trying something like the following: library mylib; import 'dart:html'; // querySelector import 'package:js/js.dart'; // javascript import 'package:angular/angular.dart'; @NgComponent( selector: 'aSelector', templateUrl: 'partial.html', cssUrl: 'style.css', publishAs: 'ctrl', map: const { 'param': '=>param' } ) class myComponent extends NgShadowRootAware { String param; Compiler

vulcanize for angular.dart?

牧云@^-^@ 提交于 2019-12-20 02:15:26
问题 There is vulcanize like tool for polymer.dart (done by polymer transformer), that nicely puts all the imported components inline and makes it easy to serve the app by reducing the number of round trips to server. Is there any tool like vulcanize for angular.dart projects? esp. the one that can pull all the component's html into a single file and make it easy for deploying angular.dart app? 回答1: You can use template-cache-transformer. From it's home page: The Template Cache Transformer