Questions tagged [angular2-dart]
20 questions
6
votes
1 answer
Angular 2 Dart: How to detect click on everything but element?
On an app with a lot of different components within one component I have a custom Auto-suggest box. The box should be closed if the user clicks anywhere but on the Auto-suggest box (or containing elements of the auto-suggest box).
This is what I…

Blackbam
- 17,496
- 26
- 97
- 150
6
votes
1 answer
Dart Component: How to return result of asynchronous callback?
Hey there I am quite new to Dart Futures and I have the following situation.
Whenever a user types a letter in the UI the addressChanged() method in my ui_component is called. This method calls the method getProposals() in my maps componenet which…

Blackbam
- 17,496
- 26
- 97
- 150
5
votes
2 answers
How to select template element by ID in Angular 2 Dart?
Relativley new to Angular and Dart I have the following problem:
my_component.dart:
import 'package:angular2/core.dart';
import 'package:angular2_components/angular2_components.dart';
import 'package:google_maps/google_maps.dart';
import…

Blackbam
- 17,496
- 26
- 97
- 150
4
votes
2 answers
Angular 2 Dart: How to share variables between parent with router and child components?
How do I share variables if having a child component with a router and keep them updated through bindings?
This is (part of) my code:
app_component.dart:
import 'package:angular2/core.dart';
import…

Blackbam
- 17,496
- 26
- 97
- 150
4
votes
2 answers
Angular 2 Dart: Template syntax - how to concatenate strings?
Feels like a dumb question but I do not get it. How can I do fast string concatenation in Angular 2 Dart templates?
I have a seperate html file for my component lets say my_component.html:
Works:
....

Blackbam
- 17,496
- 26
- 97
- 150
3
votes
1 answer
Angular 2 Dart Template syntax: How to access static methods?
Is there a way to access static methods from a template in Dart?
Problem is as follows:
offer.dart:
class Offer {
static String getPriceString(double price) {
return euroFormat.format(price) + " €";
}
}
First Try:
main_component.html:

Blackbam
- 17,496
- 26
- 97
- 150
2
votes
1 answer
Angular / Dart and Material Inputs: How to put a link into a checkbox label?
Simple question: Is this somehow possible?
If I write it like this the HTML is…

Blackbam
- 17,496
- 26
- 97
- 150
2
votes
1 answer
Angular 2 Dart: How to add body class from inside component?
My Angular 2 Dart application has many nested components. If a certain property of one of my components is set to true, a popup is shown.
If this popup is shown I want to add a class to the document body.
Pseudo code…

Blackbam
- 17,496
- 26
- 97
- 150
2
votes
2 answers
Dart/Angular 2: Pub serve 404 on page reload
There are some similar questions but I did not find any solution for this problem yet.
Lets assume I use
pub serve --port 13371
in order to start my Angular 2 / Dart application locally. In the base file I have a router configured like…

Blackbam
- 17,496
- 26
- 97
- 150
1
vote
2 answers
is there a way lazy load a component in angular 2 dart?
I have a component that uses another component with a ngIf statement. I would like to only load the second component once the ngIf evaluates to true.
EDIT: found an article that can almost do what I need:…

Jonathan
- 4,724
- 7
- 45
- 65
1
vote
2 answers
Can I have a generic method in a injectable class?
Like:
@Injectable()
class ApiService {
Future fetch(String path) {
...
}
}
this doesn't seem to work

Jonathan
- 4,724
- 7
- 45
- 65
1
vote
1 answer
Using IntelliJ IDEA and the Dart plugin, where does the Dart exceptions end up?
I've been playing with Angular2 using IntelliJ IDEA (2016.3.5) and the latest Dart plugin, and I just can't figure out where the errors, exceptions, assert failures etc. ends up.
I am running Dartium with DART_FLAGS="--checked" and pub serve seems…

taisph
- 250
- 2
- 8
1
vote
1 answer
how do I get ngModel attribute as raw string?
The component:
I would like to know the insides of ngModel but as raw string, in the above case, it would be "someobject.somevar".
But when I print the contents of …

Jonathan
- 4,724
- 7
- 45
- 65
1
vote
1 answer
form control inside ngIf is still invalidating the whole form
I have a input component that uses a Control for validation.
This component is being used within a label that has a ngIf attached.
When the ngIf is false, the input is not being rendered, thats expected and ok, but the problem is that it stills…

Jonathan
- 4,724
- 7
- 45
- 65
1
vote
1 answer
Angular 2 Dart: How to bind events correctly to dynamically generated HTML (Removing disallowed attribute )?
I want to bind a click-event to dynamically generated HTML in Angular Dart. How to do it correctly?
What I have tried:
home_component.dart:
void addHtml() {
html = """
....
""";
…
Blackbam
- 17,496
- 26
- 97
- 150
I want to bind a click-event to dynamically generated HTML in Angular Dart. How to do it correctly?
What I have tried:
home_component.dart:
void addHtml() {
html = """
....
""";
…
Blackbam
- 17,496
- 26
- 97
- 150