Routing in angular2 with Dart

Issue

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);
}

Solution

Try this HashLocationStrategy example.

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

Answered By – Christoph Lachenicht

Answer Checked By – Willingham (FlutterFixes Volunteer)

Leave a Reply

Your email address will not be published. Required fields are marked *