Code samples repository for the examples provided in "Learning Angular 2", published by Packt Publishing - THE BOOK COVERS UP TO RC.1 and hence is severely OUTDATED. PLEASE REFER TO THE LATEST EDITIONS INSTEAD.
A couple of inconsistencies arose in my code whilst trying to get the routing working. Firstly, and most importantly, my import statements in app.component.ts were set up using the following format after chapter 6
import { TIMER_DIRECTIVES } from './timer/timer'; import { TASKS_DIRECTIVES } from './tasks/tasks';
this led to issues in the @routeConfig statement where it had no reference to TaskComponent, TaskEditorComponent or TimerComponent.
I had to change the imports to explicitly mention the components that we are using, which seems to devalue the use of the barrel in the first place.
import {TimerWidgetComponent} from './timer/timer'; import {TaskComponent,TaskEditorComponent} from './tasks/tasks';
Secondly, the naming of the components has changed between the chapters. I had TimerWidgetComponent and TaskComponent (singular) which added more confusion.
A couple of inconsistencies arose in my code whilst trying to get the routing working. Firstly, and most importantly, my import statements in app.component.ts were set up using the following format after chapter 6
import { TIMER_DIRECTIVES } from './timer/timer'; import { TASKS_DIRECTIVES } from './tasks/tasks';
this led to issues in the @routeConfig statement where it had no reference to TaskComponent, TaskEditorComponent or TimerComponent.
I had to change the imports to explicitly mention the components that we are using, which seems to devalue the use of the barrel in the first place.
import {TimerWidgetComponent} from './timer/timer'; import {TaskComponent,TaskEditorComponent} from './tasks/tasks';
Secondly, the naming of the components has changed between the chapters. I had
TimerWidgetComponent
andTaskComponent
(singular) which added more confusion.