B
B
Boogie19892016-09-02 16:26:01
JavaScript
Boogie1989, 2016-09-02 16:26:01

Angular 2 nested directives?

About half a year ago, while studying Angular 2, I wrote a small application and forgot about it. Now I want to continue my studies, but I see that a lot has already changed in it. Suppose earlier nested components were connected directly to the component in the directives array

@Component({
    selector: 'app-root',
    templateUrl: ',
                directives:[]
  })

now there is @NgModule. As I understand it, all components are connected to it? Some kind of module.id appeared - what is it for? If it’s not difficult for someone, I’ll be glad to help)
And yet, is there any point in starting to learn ng2 in depth, or is it too early?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
B
bromzh, 2016-09-20
@bromzh

About modules (NgModule): https://angular.io/docs/ts/latest/guide/ngmodule.html
module.id is a bit different. It is used by SystemJS during assembly and is needed so that the paths to templates and styles are relative to the current file: schwarty.com/2015/12/22/angular2-relative-paths-fo...
It's time to start learning ng2, since the release is already out.
Of course, there is an outDir option for this. https://www.typescriptlang.org/docs/handbook/compi...

B
Boogie1989, 2016-09-09
@Boogie1989

Another question is, is it possible to configure the ts compiler so that it puts all js files in a separate folder, and not picks up ts files?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question