angular-dart

Are the Controllers in Dart singleton

僤鯓⒐⒋嵵緔 提交于 2019-12-12 18:32:57
问题 I know we can create singleton classes using the factory in Dart. But i happen to recall reading somewhere, classes registered using type(MyController) or type(MyServiceClass) happen to be singleton on their own. Is that true? If so, does it apply to just classes registered with type(MyController) or does it use the annotation @NgController, etc. How does that impact the service and factory classes we write. Also, where can i find a doc or link explaining the same. 回答1: Short answer: No,

How do I use a component twice in a prent and child views (DI is shared and the comp is a singleton)

僤鯓⒐⒋嵵緔 提交于 2019-12-12 18:09:09
问题 I have a button component (with app specific behavior) that i intended to use widely in the app. The issue is that when I have a parent/child views where I use this button, a click on the paren't button triggers the [action] of the child's view button : naturally you don't get what's happening if you don't have some years of object oriented programming. (which is pretty a bad point to get young school novices to use dart...) Just to explain the problem : each component in dart is a singleton

AngularDart: How to include subcomponents in a custom component template

落爺英雄遲暮 提交于 2019-12-12 14:51:25
问题 I've created a tabs component in AngularDart @Component( visibility: Directive.CHILDREN_VISIBILITY, selector: "rtabs", templateUrl: "packages/myapp/components/rtabs.html", publishAs: "cmp", useShadowDom: false ) class RTabsComponent { @NgAttr('label') String label; int selectedTabIndex = 0; RTabsComponent(){ } var tabs = new List<RTabComponent>(); add(RTabComponent tab) { tabs.add(tab); } } @Component( selector: "rtab", template: "<content></content >", publishAs: "cmp", useShadowDom: false )

Creating an Angular.Dart Cube component with 6 template arguments

纵然是瞬间 提交于 2019-12-12 13:09:24
问题 I'm trying to create an Angular.Dart Component, which is intended to be a Cube. Each side of the cube will contain it's own inner HTML, and a property of this component will set which of the sides is the current visible side. (Only one of the sides is active at a time) My question is - how can I create a component which receives 6 template-arguments, each of them will be inserted as a specific cube-side inner HTML? This is what I want to create: <cube> <sideA>Content of side A</sideA> <sideB

Struggling to implement tabs in AngularDart

馋奶兔 提交于 2019-12-12 09:45:55
问题 I am trying to learn Dart and AngularDart. Initially all was good until I decided to try and implement a tab component based on the example similar to the Angular home page e.g. <tab> <panel name="betty"> Content of betty tab </panel> <panel name="bob"> Content of bob tab </panel> </tab> I have implemented following components. @NgComponent( selector: 'tab', templateUrl: 'components/tab_component.html', cssUrl: "http://netdna.bootstrapcdn.com/bootstrap/3.0.2/css/bootstrap.min.css", publishAs:

Progressive web app and AngularDart

百般思念 提交于 2019-12-12 08:54:52
问题 I am currently looking for a web framework for my next project and for some reasons I'm interested in angular dart . But at the same time I want my webapp to follow PWA guidelines. I searched quite a lot, but I haven't found an example of PWA in angulardart. I saw some examples for the JS counterpart or found pwa dart package, but I lack the knowledge of angulardart framework to know if it's possible in dart. So, is it possible to make a PWA in angulardart ? 回答1: Deferred loading in plain

How to access a AngularDart components attribute (NgOneWay) outside of the component, eg. on the page it is in?

隐身守侯 提交于 2019-12-12 06:28:27
问题 Here is a AngularDart component in a page. <body> <testcomponent></testcomponent> <p>Should have value {{testcomponent.test}}</p> </body> The component has a NgOneWay of @NgOneWay("test") String test = "HELLO"; This does not work as no value is shown on the page. The component can show its NgOneWay within the components HTML but I wish to access it outside of the components HTML on the page where the component is used. Is there any way to show the components NgOneWay on the page in which the

Routes in DART, s server required?

Deadly 提交于 2019-12-12 01:57:39
问题 I tried both AngularDART routes, and routes with Polymer, this example but found, that none is working once I open the file from Dartium directly, but both work perfectly once I run them from Dart editor! am I doing something wrong! thanks 回答1: This is because when you run from DartEditor (Ctrl+R) pub serve is launched which acts as a web server for the browser. This doesn't mean that you need a web server to run this example though. What makes the difference is that pub serve runs

PhpStorm - Two Dart web apps in one project

旧城冷巷雨未停 提交于 2019-12-11 18:24:10
问题 I have a Dart project in PhpStorm and I have two web (Angular Dart) modules (or subprojects?) I have a problem how to run/debug them as PhpStorm created very same JavaScript Debug configurations. When I had only one it worked well. Directory structure is ~/Zdrojaky/src/dart/app/Vavrinec (the main project) with two subdirs Admin and Owner . Run/Debug conf is same for both. Is it possible to Run/Debug two web Angular Dart (or JS) apps in one PhpStorm project? I would expect different port or

How to notify parent component of change and refresh view

隐身守侯 提交于 2019-12-11 17:07:23
问题 I want to notify a parent component from a child component to update a view in the parent component. I'm using the @Output annotation to do that. In the parent component the function "loadPosts()" is actually invoked, but the view is not updated. Does anybody know why? What happens: place_component contains a "list-post" directive, which displays all posts. place_component contains a modal, to add a new post with a directive "new-post" When a new post is saved, a message is parsed back over