For example, we have a modal component, it can config that using ng-template as a configurable template. <ng-template #auModalBody></ng-template> <au-modal [body]="auModalBody" ></au-modal> Now what we want to do is to pa…
User input validation is a core part of creating proper HTML forms. Form validators not only help you to get better quality data but they also guide the user through your form. Angular comes with a series of built-in validators such as required or ma…
Introduction After having gone through many project: Project A Project B Project C I start to write a conclusion it explained how to use mvc template. My effort in this articles series will be to cover some best practice of mvc. We will be gradually…
背景 之前项目使用过vue.js+iview,习惯了后端开发的我,总觉得使用不习惯,之前分析易企秀前端代码,接触到了angular js,完备的相关功能,类似后端开发的体验,让人耳目一新,全新的angular拥抱typescript,更是为后端开发量身打造, 学习angular,可以参考学习笔记: Angular快速学习笔记(4) -- Observable与RxJS Angular快速学习笔记(3) -- 组件与模板 Angular快速学习笔记(2) -- 架构 Angular 快速学习笔记(…
I can use <tamplete> syntax and a entry component as a container to create a dynamic component. Notice it will create a empty div as a placeholder in the DOM. If we don't wanner this empty div, we can actually using ng-conainer together with ngTempl…
This lesson covers Angular 2’s version of looping through data in your templates: ng-for. It’s conceptually the same as Angular 1’s ng-repeat, but you’ll find the syntax quite different as it aligns with #refs in Angular 2 and JavaScript “for of” loo…
1,错误如图所示 简单说下错误原因是:没有js没有注册进去. 解决方法: 1.看下index.html有没有引入你的js文件. 2.看下app.js有没有注册js,比如我这次就是这步没做好,合并代码时冲掉了.如图 在后面加上丢失的invoidFolder.controllerrjs就好了.希望对别人有帮助…
报出来的时候,出现这种错误,是因为在引入控制器的时候没有引入成功,我遇到这个错误是在因为没有将父控制器引入到子控制器中.…
Now for au-modal component, we pass in tow component though contenct projection: <au-modal class="auth-modal" #modal *auModalOpenOnClick="[loginButton, signUpButton]" [closeOnClickOutside]="true" [closeOnEsc]="true&qu…
当我第一次被分配到“修正执行ng lint语句后的错误”这项任务前,我就被导师提前告知这是一个很无聊的任务,当我开始后,我发现其实有一些办法可以加快这个无聊单调的工作.接下来,我就分享一下我的经验. 首先还是要来讲一讲 ng lint 的相关知识: 通过Angular CLI的执行语句 ng new XXX 创建新项目后,目录中会包含一个tslint.json文件,这个文件就是用来定义一个统一的代码风格. 有一些错误可以通过 ng lint -fix 自动解决,这个过程也许比较漫长.能自动修复的…