Angular 1.5 introduced the .component() helper method, which is much simpler than the.directive() definition and advocates best practices and common default behaviours. Using .component() will allow developers to write in an Angular 2 style as well,…
The main idea for testing contianer component is to make sure it setup everythings correctlly. Call the onInit() lifecycle first, then the variables have the right value. Methods will be called with the right params. Container component: import { Com…
报错现象: 用modal打开某个组件页面时报错 报错:No component factory found for UpdateAuthWindowComponent. Did you add it to @NgModule.entryComponents? 原因: 使用loadChild模式加载对应路由下的组件时,是懒加载模式,即需要的时候才会加载,所以如果路由走的是懒加载模式,需要的module即使在app.module中引入过了,依旧需要再引入一次 解决方案: 在app.module 的e…
Showing you how you can expose properties on your Controller to access them using #refs inside of your template. // letterSelect.ts import {Component, View, FORM_DIRECTIVES, NgFor} from 'angular2/angular2'; @Component({ selector: 'letter-select' }) @…
The way to test router componet needs a little bit setup, first we need to create a "router-stubs.ts". This file is a helper file. // export for convenience. export { ActivatedRoute, Router, RouterLink, RouterOutlet} from '@angular/router'; impo…
Download Source - 955.2 KB Content Part 1: Angular2 Setup in Visual Studio 2017, Basic CRUD application, third party modal pop up control Part 2: Filter/Search using Angular2 pipe, Global Error handling, Debugging Client side Part 3: Angular 2 to Ang…
本文转自:https://www.techiediaries.com/angular-material-dialogs/ In this tutorial, we're going to learn how to use the Angular Material Dialog component to build a custom dialog example. We'll also see common cases to work with the Angular Material Dialo…
---------------------------Scope-------------------------------- https://docs.angularjs.org/guide/scope What are Scopes? Scope is an object(是一个数据模型) that refers to the application model. It is an execution context(scope是表达式的执行上下文) for expressions. Sc…
原文:https://coryrylan.com/blog/angular-multiple-http-requests-with-rxjs --------------------------------------------------------------- Cory Rylan Nov 15, 2016 Updated Feb 25, 2018 - 5 min readangular rxjs This article has been updated to the latest v…
What is a module in AngularJS? A module is a container for different parts of your application i.e controllers,services,directives,filters,etc. You can think of a module as a Main() method in other types of applications. How to create a module? Use t…
原址: https://zhuanlan.zhihu.com/p/30853705 原文: 中文代码示例教程之Angular尝试 为了检验中文命名在Angular中的支持程度, 把Angular官方入门教程的示例代码中尽量使用了中文命名. 以下源码库在此. 创建项目 不支持中文命名: $ ng new 英雄榜Project name "英雄榜" is not valid. New project names must start with a letter, and must cont…