Issue Consider this dead-simple Angular Dart component: import ‘package:angular/angular.dart’; @NgComponent( selector: ‘el’, templateUrl: ‘./component.html’, publishAs: ‘ctrl’, map: const { ‘foo’: ‘@foo’ } ) class MyElement { String foo; MyElement(Scope scope) { scope[‘bar’] = ‘bar’; } } The foo field is
Continue readingTag: angular-dart
AngularDart components and model binding
Issue Is it possible to bind an AngularDart ngComponent to a model and then manipulate that model from the component and see the changes outside of the changes outside of ngComponent. For example <myawsomecomponent ng-model=”{{name}}”></myawesomecomponent> <label>{{name}}</label> myAwesomeComponent will do some
Continue readingis it possible to access attributes set in HTML in an angular.dart constructor?
Issue I cannĀ“t access the attribute val in the constructor of this component @NgComponent( selector: ‘dartcomp’, templateUrl: ‘dartComp.html’, publishAs: ‘ctrl’, map: const { ‘val’ : ‘@val’ } ) class DartComp { String val; DartComp() { print(“construktor DartComp $val”); } }
Continue readingDI code generator generated code uses non-existing function `ensureFunction`
Issue I tried di Code Generator from the AngularDart tutorial but the generated code contains a lot of lines like: “incrementHours()”: (scope) => ensureFunction(_incrementHours(scope), “incrementHours”)(), but the function ensureFunction() is unknown. Any idea what I’m doing wrong? Solution It’s not
Continue readingCreating a redirect in Angular Dart
Issue I have two views, about.html and bio.html and would set up a redirect from the first to the second. I would expect the following to work, but it doesn’t. Any idea why? Here is the controller code: # my_controller.dart
Continue readingPuzzled by CSS selector to trigger controller
Issue I’m having trouble understanding how an attribute selector can be used to restrict the scope of a controller. Here’s the minimal controller code: import ‘package:angular/angular.dart’; @NgDirective( selector: ‘[my-controller]’, publishAs: ‘ctrl’ ) class MyController { String foo = ‘fooooooooooooo’; }
Continue readingIs there a better way to reference a route by name in a link with AngularDart?
Issue I have many named routes in my AngularDart app. I create links the old fashioned way, like this: <a href=”#/activities”>Go</a> That seems brittle. If I change the path or change the strategy away from hash change, I need to
Continue readingSurprising error message in Angular Dart relating to watchers
Issue I’m writing a component that takes a String and converts it into a list of <span>s. Each <span> gets a String character and is assigned a random color. The component invocation looks like this: <span ng-repeat=”char in ctrl.chars” style=”color:
Continue readingAngularDart custom filter call() method required to be idempotent?
Issue 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
Continue readingAngular Dart $scope.$on functionality is not working
Issue I want to call a destroy function when the dart-angular controller are removed. This is the angular.js solution. $scope.$on(“$destroy”, function() { alert(“destroy”); }); My try in Dart class TestController… TestController(Scope $scope){ $scope.$on(“$destroy”,(){ print(“destroy”); }); } and this is the
Continue reading