SHARE

—– COURSE LINKS:
+ Repo – https://github.com/iamshaunjp/angular-2-playlist
+ Atom editor – https://atom.io/
+ Download Node.js – https://nodejs.org/en/

———————————————————————————————
You can find more front-end development tutorials on CSS, HTML, JavaScript, jQuery, WordPress & more on the channel homepage…

SUBSCRIBE TO CHANNEL – https://www.youtube.com/channel/UCW5YeuERMmlnqo4oq8vwUpg?sub_confirmation=1

========== PSD to WordPress Playlist ==========

https://www.youtube.com/playlist?list=PL4cUxeGkcC9gnow7e45LQFkNVxwQ5BH-W

============ Node.js for Beginners Playlist =============

https://www.youtube.com/playlist?list=PL4cUxeGkcC9gcy9lrvMJ75z9maRw4byYp

============== The Net Ninja =====================

For more front-end development tutorials & to black-belt your coding skills, head over to – https://www.youtube.com/channel/UCW5YeuERMmlnqo4oq8vwUpg or http://thenetninja.co.uk

================== Social Links ==================

Twitter – @TheNetNinja – https://twitter.com/thenetninjauk

21 COMMENTS

  1. hmm.. most likeley because we are using different versions of the CLI, but my version is not gengerating that index file you got in your home.component. So, i'm getting an error when trying to write my directive. Any suggestions ..?

  2. im using visual studio code as an IDE and i didnt import my HomeComponent into Rootcomponent.I used selector "app-home " into root's app.component.html and it is still working.Is there any difference between atom.io and VSC by which im didnt have to import component?

  3. I tried this today, and it worked when it was in the state of the last video at the end. I don't know if I have an auto import plug-in, but I don't see any import messages. Can anyone confirm Angular updated and is different now?

  4. ERROR in /home/awadhesh/angular/project/src/app/app.component.ts (2,31): Cannot find module './home'.

    ERROR in /home/awadhesh/angular/project/src/app/app.component.ts (8,3): Argument of type '{ selector: string; templateUrl: string; styleUrls: string[]; directives: any[]; }' is not assignable to parameter of
    type 'Component'.
    Object literal may only specify known properties, and 'directives' does not exist in type 'Component'.

    ERROR in ./src/app/app.component.ts
    Module not found: Error: Can't resolve './home' in '/home/awadhesh/angular/project/src/app'
    @ ./src/app/app.component.ts 11:0-39
    @ ./src/app/app.module.ts
    @ ./src/main.ts
    @ multi webpack-dev-server/client?http://localhost:4200/ ./src/main.ts

    how can i solve it

  5. hallo can someone explain how to connect the filter input and the ninja list display if they are not in the same component

  6. Hey, Shaun, apparently the "directives" you placed in the Component doesn't exist anymore and has been removed from Angular 2. What replacement would you recommend I use instead? I get an error under the whole line "directives: [HomeComponent]".

  7. Hi Ninja, first of all thank you for such a great videos for new bees like me. i have a query in my case it is working without importing and including directives. so should i assume that we don't have to include directive while nesting components ?

  8. like Jason Smith said, the previous lesson of creating component was perfect enough to automatically nest "home" component to app component (root). Thereas, making less trouble of creating a directives and all of mumbo-jumbo. I wonder if you still need to import "HomeComponent" class though… i think it goes auto when you use <app-home> </app-home> directives.

  9. I didn't even had to do that. It worked right out of the box. I just typed
    <app-home>Loading…</app-home> in the app.component.html.

    worked like a charm…
    : )

  10. Hello,

    For directives
    Problem fixed:

    Make sure to use the ng commands used in these videos.
    for creating components ng generate component

    Angular2 will take care of it automatically, no need to import or add anything
    Just add selector tags in root component i.e app component

    Thanks

  11. hello Mr Ninja, has there been an update to angular2 because The <app-home> tag worked in the HTML file without needing to import the component

  12. Hey Ninja

    The directives tag doesn't show for me… it gives me an error…

    directives: [HomeComponent]
    is not getting complied for me…

    please help…

  13. For those struggling on a later release, use the following import statement instead
    import { HomeComponent } from './home/home.component';

    And skip the "directives" line, it is no longer needed

  14. thanks a lot Ninja for those great tutorials! I think there r some changes in the final release of angular 2. for example there's no need to import or adding directives of any added component to app.component. Isn't it?!

LEAVE A REPLY

Please enter your comment!
Please enter your name here