We are going to have a modal component: <au-modal > </au-modal> And we can pass default modal body by content projection: <au-modal > <modal-body></modaö-body> </au-modal> So 'modal-body' will be shown by default. Now w…
Angular 1 provided a mechanism to place content from your template inside of another template called transclusion. This concept has been brought into Angular 2 and was renamed to content projection and given super powers. In this lesson learn how to…
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…
For example there is tow form compoennts on the page, and what we want to do is reusing the form component. Make to tow form behave differently, we can using <ng-content> inside form and pass what we want from the parent component. // app.component.…
本篇博客的内容也不算太复杂,算是AutoLayout的一些高级的用法.本篇博客我们主要通过一些示例来看一下AutoLayout中的Content Hugging Priority以及Content Compression Resistance Priority这两个优先级.下方我们先来简单的看一下这两个优先级的涵义: Content Hugging Priority:直译成中文就是"内容拥抱优先级",从字面意思上来看就是两个视图,谁的"内容拥抱优先级"高,谁就优先环…
angular2中的内容映射: App.component: <my-day> <my-lucky> </my-lucky> </my-day> MyDay.component: selector:'my-day' template`<h1>my day </h1> <ng-content></ng-content> ` MyLucky.component: selector:'my-lucky', templ…
TableViewCell的高度计算应该是所有开发者都会使用到的东西,之前都是用代码计算的方法来计算这个高度.最近有时间看了几个计算Cell高度的方法.基本上都用到了AutoLayout,这篇首先介绍一下需要了解的三个AutoLayout属性. 一.名词解析 intrinsicContentSize:字面意思就是固有的大小.就是说在没有受到约束影响时本来应该有的大小. Content Hugging Priority:字面意识是内容压缩优先级.就是说阻止view返回的实际尺寸比intrinsic…
一. 这次完成了content部分的右边图片以及content的top部分的边角填充 <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>D139_FrameworkeOfNeteasyInterface</title> <style> .header{ width:960px; height:8…
报错代码如下: <div ng-controller="HelloAngular"> <p>{{greeting.text}},angular</p> </div> function HelloAngular($scope){ $scope.greeting = { text:'hello' } } 在用angular1.3版本以前的时候,上面的代码运行是没有问题的.但是我更新版本后报错 Error: [ng:areq] http://e…
npm install -g angular-cli ng -v ng new project_name cd project_name ng serve 浏览器打开输入 localhost:4200…