5

I'm new to Angular2, till now I got succeeded to write the 5 Min Quickstart.

I want to learn how to use routing in Angular2 and Dart, unfortunately I couldn't find any example on the web yet. most of the articles are talking about routing with typescript which I couldn't get it work with dart.

I'm using webstorm with dart plugin.

import 'dart:html';
import 'package:angular2/angular2.dart';
import 'package:angular2/bootstrap.dart';
import 'package:angular2/router.dart';

@Component(selector: 'my-app', template: '<h1>My First Angular 2 App</h1>')
class AppComponent {}

void main() {
  bootstrap(AppComponent);
}
Günter Zöchbauer
  • 623,577
  • 216
  • 2,003
  • 1,567
Murhaf Sousli
  • 12,622
  • 20
  • 119
  • 185
  • I can't see how the code you posted is related to routing. Do you have a concrete TypeScript example you want to make work in Dart? – Günter Zöchbauer Nov 01 '15 at 21:11
  • http://www.syntaxsuccess.com/viewarticle/routing-in-angular-2.0 Can you convert this to dart? @GünterZöchbauer – Murhaf Sousli Nov 01 '15 at 21:15
  • If you already tried to port this to Dart yourself please provide a GitHub example and add some information to your question where you're stuck or what error you get. – Günter Zöchbauer Nov 01 '15 at 21:17
  • I can't make syntax myself otherwise I wouldn't post this question! I want a general and simple using of routing in dart, nothing specific @GünterZöchbauer – Murhaf Sousli Nov 01 '15 at 21:20
  • Stackoverflow.com is only for specific questions. I didn't ask for a working Dart port but you should demonstrate some effort to solve the problem yourself and then provide a reproducible example that demonstrates your problem. This isn't a give me some code site. – Günter Zöchbauer Nov 01 '15 at 21:27

2 Answers2

4

Try this HashLocationStrategy example.

https://github.com/ng2-dart-samples/todomvc

2

I found this tutorial quite helpful to set up routing in my application.

Leukipp
  • 550
  • 2
  • 9
  • 25