课程: Angular Essential Training
今天就学习课程吧!
今天就开通帐号,24,700 门业界名师课程任您挑!
Angular directive classes
- [Instructor] Earlier in this course, we looked at the directive decorator and how to use it to build angular directives. In this video, we'll look at one way to write a directive class. I opened our project here in a GitHub codespace. I talk about why we use codespaces earlier in this course. So for now, just think of them as an easy way to share and write code without installing anything on your local machine. I'll go to the src folder. Open up the app folder, directives and click on online-status.directive.ts to open the file. Always use the directive.ts ending for your directive file names. The Angular CLI tool does this for you when you generate new directives using the ng generate directive command. We export the directive class itself on line 8. You can call your directive classes anything you like but it's good practice to end the class name with the word directive. This class implements the AfterContentInit…
随堂练习,边学边练
下载课堂讲义。学练结合,紧跟进度,轻松巩固知识。
内容
-
-
-
-
-
(已锁定)
Overview of Angular pipes2 分钟 11 秒
-
(已锁定)
Using built-in Angular pipes4 分钟 54 秒
-
(已锁定)
Using custom Angular pipes4 分钟 39 秒
-
(已锁定)
Angular services and the injectable decorator2 分钟 54 秒
-
(已锁定)
Angular service classes5 分钟 43 秒
-
(已锁定)
Angular directive decorator2 分钟 45 秒
-
(已锁定)
Angular directive classes4 分钟 17 秒
-
(已锁定)
-
-
-
-
-