Allow more than one child component of the same type. Allow child components to be placed within the views of other custom components. In previous post, we have seen how to use @ContentChild to asscomplish compound component implementation. It has so…
Allow the user to control the view of the toggle component. Break the toggle component up into multiple composable components that can be rearranged by the app developer. Compound component mainly for rendering flexibility. It hides the implements de…
An Angular service registered on the NgModule is globally visible on the entire application. Moreover it is a singleton instance, so every component that requires it via its constructor, will get the same instance. However this is not always the desi…
Both Smart Components and Presentation Components receive data from Services in entirely different ways. Smart Components use constructor injection to lookup the entire service from the injector while Angular 2 Presentation components take the data f…
原文: https://medium.com/@jorgecasar/how-to-use-web-components-with-angular-41412f0bced8 ------------------------------------------------------------- I already told you about Web Components and Frameworks and now we have to put it into practice so tha…
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…
一.准备 angular的源码一份,我这里使用的是v1.4.7.源码的获取,请参考我另一篇博文:angular源码分析:angular源代码的获取与编译环境安装 二.什么是依赖注入 据我所知,依赖注入的概念最早使用时在java编程中.依赖注入和控制反转差不多是一个概念,是编程中一种重要的解耦手段.依赖注入不是目的,它是一系列工具和手段,最终的目的是帮助我们开发出松散耦合.可维护.可测试的代码和程序.这条原则的做法是大家熟知的面向接口,或者说是面向抽象编程.具体含义是:当某个角色(可能是一个对象实…
为什么我会准备写这个原创教程系列? 写下这个标题之后,看着屏幕上空白的内容区,不知从何下手,想说的似乎有很多,似乎又没啥说的.有时候就会陷入这种矛盾中,有时候就是这样,于是,我下定决心这一次一定要把这个系列完成. 博客园开了博客也有段时间了,中间有把其他地方写的博客搬家过来的,也有转自大神的,也写过一些文字.然而一直以来都没有一个完整的系统,虽然我心里一直想系统整理下,在这种情况下,我看到了一篇文章<你为什么不分享>.于是乎我本着一颗博爱的心来写下下面的每一个文字. 如果接下来的文字对你有些许…
原文链接: Angular Dependency Injection翻译人员: 铁锚翻译时间: 2014年02月10日说明: 译者认为,本文中所有名词性的"依赖" 都可以理解为 "需要使用的资源". Dependency Injection (DI,依赖注入)是一种软件设计模式,用于处理如何让程序获得其依赖(对象的)引用. 关于 DI 的深入讨论,请参考 维基百科中 Dependency Injection, Martin Fowler 编写的 控制反转(Inver…
原版地址:http://code.angularjs.org/1.0.2/docs/guide/di 一.Dependency Injection(依赖注入) 依赖注入(DI)是一个软件设计模式,处理代码如何得到它所依赖的资源. 关于DI更深层次的讨论,可以参观Dependency Injection(http://en.wikipedia.org/wiki/Dependency_injection),Inversion of Control(http://martinfowler.com/ar…