angular-dart

Passing multiple parameters to a structural directive in AngularDart 5

荒凉一梦 提交于 2020-01-16 19:07:53
问题 I want to pass in multiple params to a structural directive, but what was working in Angular2 doesn't seem to work in Angular5 anymore Here's my blah component which contains an accordion: @Component( selector: "blah-scene", // language=HTML template: """ <div> Blah Test Page <accordion> <div *accordionItem> item1 </div> <div *accordionItem> item2 </div> </accordion> </div> """, directives: const [ Accordion, AccordionItemDirective ] ) class BlahScene implements AfterContentInit, OnDestroy {

is it possible to access attributes set in HTML in an angular.dart constructor?

*爱你&永不变心* 提交于 2020-01-16 01:20:11
问题 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"); } } which was used in index.html <dartcomp id="dc" val="x"></dartcomp> Is there a way to access val in the constructor? 回答1: Extend NgAttachAware , implement the method attach() and access your field there. When attach() is called

When I dynamically add HTML using ng-bind-html how can I initiate a compile for this HTML

核能气质少年 提交于 2020-01-16 01:08:08
问题 My index.html contains the following element ... <div class="col-md-6" ng-bind-html='module.docs.html'></div> ... The module.docs.html property returns HTML like <div ng-controller="accordion-demo-ctrl"> <label class="checkbox"> <input type="checkbox" ng-model="oneAtATime"> Open only one at a time </label> <accordion close-others="oneAtATime"> <accordion-group heading="Static Header, initially expanded" is-open="true"> This content is straight in the template. </accordion-group> <accordion

How Do I Install Dart v2?

穿精又带淫゛_ 提交于 2020-01-14 12:41:34
问题 Ive looked all over the official Dart site. They go into great depth about 'dev' channels and 'stable' channels but no clue whatsover about how to actually install a version of the SDK. There is no information about the current stable and dev versions either. Clearly I have missed something hiding in plain site. I want to try out some official angulardart component libraries but the builder requires Dart version 2 - but I have no idea how to get that. Can someone put me out of my misery, and

Access controller method from component and/or directive?

梦想与她 提交于 2020-01-14 02:08:56
问题 I have a component that performs a task, but then needs to refresh the data (a method callable from the controller). Is it possible to access the controller methods and properties from a component? Is it available through Scope? Parent/root scope? (Also noticed I'm using a directive as well which would love to access the parent scope) 回答1: I used $broadcast ... Not sure if that's the proper way to do it or not. I imagine trying to access the controller from component/directive is circular? So

Upgrading to Dart2/Angular5 Error importing template.dart

大憨熊 提交于 2020-01-13 20:23:13
问题 I am upgrading my dart/angular project to dart 2.x/angular 5.x. The sample in phpstorm works, but when I build my project, then I am getting following error: [SEVERE] build_modules|modules on lib/app_component.template.dart: Bad state: No element [SEVERE] build_web_compilers|entrypoint on web/main.dart: Unable to find modules for some sources, this is usually the result of either a bad import, a missing dependency in a package (or possibly a dev_dependency needs to move to a real dependency),

AngularDart: How do you pass an event from a Child component to a second level parent

限于喜欢 提交于 2020-01-11 11:30:09
问题 I am using StreamControllers with Events, and essentially I have a 3 level component heirarchy lets call them, A,B,C. The heirarchy is A -> B -> C. The origin of the event is in c and i want the event to be processed by A. I know this is rather easy to do with a direct parent -> child relationship using @Output but not sure how to properly handle multiple levels upwards. 回答1: Thanks for asking. There are a couple ways to do this. (1) Create an event handler in B that forwards from C

Populating derived fields in an Angular Dart component

匆匆过客 提交于 2020-01-11 10:12:32
问题 I have a component that takes a single attribute. I want to populate a field in the component with a value that is derived from this attribute. I am running into the problem that the binding with the attribute has not happened when the code inside the constructor runs. How, then, do I set the value of the derived field? Here is some code: import 'package:angular/angular.dart'; @NgComponent( selector: 'tokens', templateUrl: './component.html', cssUrl: './component.css', publishAs: 'ctrl', map:

Populating derived fields in an Angular Dart component

三世轮回 提交于 2020-01-11 10:11:11
问题 I have a component that takes a single attribute. I want to populate a field in the component with a value that is derived from this attribute. I am running into the problem that the binding with the attribute has not happened when the code inside the constructor runs. How, then, do I set the value of the derived field? Here is some code: import 'package:angular/angular.dart'; @NgComponent( selector: 'tokens', templateUrl: './component.html', cssUrl: './component.css', publishAs: 'ctrl', map:

Is it possible to use an Angular 2 Dart frontend with a Node.js backend?

匆匆过客 提交于 2020-01-06 20:13:36
问题 I am planning out the tools I will use in my web app. I would like to use Node.js as a server backend because it has a module that would be particularly useful to me. However, I would also like to use Angular 2 (Dart) with Polymer.dart in the frontend. Excuse me if the answer should be obvious, but how will it work to combine these two parts of my app seamlessly (and without conversion tools), as is commonly done in the MEAN stack, since Dart is not directly compatible with JS? There aren't