deeleman / learning-angular2

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.
https://www.packtpub.com/web-development/learning-angular-2
108 stars 59 forks source link

Chapter 4 Section 3 #31

Closed RichLinnell closed 8 years ago

RichLinnell commented 8 years ago

In the Component definition the code reads as follows

constructor() {
    const TasksService: TasksService = new TasksService();
    this.tasks = taskService.taskStore;
    this.today = new Date();
  }

Firstly, the TaskService is defined as class TaskService so the first line of the constructor should read const TasksService: TaskService = new TaskService();

Secondly, if we are going to call the const TasksService then the second line should read this.tasks = TasksService.taskStore;

deeleman commented 8 years ago

Damn, now I get it. I'm afraid you are reading a VERY early edition of the book. The code you refer belongs to chapter 5 in the current edition and is now completely different in order to take full advantage of the DI layer.

Would you please check wether the book os named "Angular 2 Essentials"? If so, please refer to Packt with a proof of purchase and request a replacement.

Packt released that book by mistake and the codebase has dramatically changed ever since. The actual name of the book is "Learning Angular 2" and is up to date with Angular 2 RC.1 (although it should compile seamlessly up to RC.3).

In the meantime, please refer to the code examples in this repository.

RichLinnell commented 8 years ago

In reading the book on Safari Books Online. You may need to let them know.

Hopefully I'm not learning the wrong stuff!

Rich. On Sun, 14 Aug 2016 at 13:25, Pablo Deeleman notifications@github.com wrote:

Damn, now I get it. I'm afraid you are reading a VERY early edition of the book. The code you refer belongs to chapter 5 in the current edition and is now completely different in order to take full advantage of the DI layer.

Would you please check wether the book os named "Angular 2 Essentials"? If so, please refer to Packt with a proof of purchase and request a replacement.

Packt released that book by mistake and the codebase has dramatically changed ever since. The actual name of the book is "Learning Angular 2" and is up to date with Angular 2 RC.1 (although it should compile seamlessly up to RC.3).

In the meantime, please refer to the code examples in this repository.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/deeleman/learning-angular2/issues/31#issuecomment-239670944, or mute the thread https://github.com/notifications/unsubscribe-auth/AAMdldBBETZLBue7QbkVt4YCafyBW3lRks5qfwk8gaJpZM4JejJG .

deeleman commented 8 years ago

What is the book name on the frontcover?

RichLinnell commented 8 years ago

This is the one I'm reading.

On Sun, 14 Aug 2016 at 14:14, Pablo Deeleman notifications@github.com wrote:

What is the book name on the frontcover?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/deeleman/learning-angular2/issues/31#issuecomment-239672870, or mute the thread https://github.com/notifications/unsubscribe-auth/AAMdlYAKH3-eXPrWzQjbLu2USluN5ZdJks5qfxSggaJpZM4JejJG .