Summary: this tutorial will introduce you to
the directives with @NgModule and show you how to apply it
to Use the declarations array for directives.
Introduction to directives with @NgModule
Why using directives with @NgModule ?
In this article you learn most impotent Use the
declarations array for directives. To use a directive, component, or pipe
in a module, you must do a few things:
- Export it from the file where you wrote it.
- Import it into the appropriate module.
- Declare it in the @NgModule declarations array.
Those three steps look like the following. In the file where
you create your directive, export it. The following example, named ItemDirective is
the default directive structure that the CLI generates in its own file, item.directive.ts:
Summary: this tutorial will introduce you to
the directives with @NgModule and show you how to apply it
to Use the declarations array for directives.
Introduction to directives with @NgModule
Why using directives with @NgModule ?
In this article you learn most impotent Use the
declarations array for directives. To use a directive, component, or pipe
in a module, you must do a few things:
- Export it from the file where you wrote it.
- Import it into the appropriate module.
- Declare it in the @NgModule declarations array.
Those three steps look like the following. In the file where
you create your directive, export it. The following example, named ItemDirective is
the default directive structure that the CLI generates in its own file, item.directive.ts:
0 comments:
Post a Comment