<p>
child works!
</p>
<ng-content></ng-content>
<app-child>
父组件投影
</app-child>
<p>
child works!
</p>
<ng-content select=".header"></ng-content> <ng-content select=".footer"></ng-content>
<app-child>
<div class="header">页头</div>
<div class="footer">页脚</div>
</app-child>
<div [innerHTML]='div1'></div>
import { Component } from '@angular/core';

@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent {
title = 'app';
div1 = '<div>aaa</div>';
}

angular ng-content的更多相关文章

  1. [Angular] Configurable Angular Components - Content Projection and Input Templates

    We are going to have a modal component: <au-modal > </au-modal> And we can pass default ...

  2. angular ng build --prod 打包报错解决方案

    使用以下代码  就不报错了 ng build --prod --no-extract-license    打包命令 使用以下代码  就不报错了 ng build --prod --no-extrac ...

  3. angular ng指令

    1.指令 ng-app,ng- 都是angular的指令系统ng-app: ng-app是angular的初始化,一个页面只能有一个ng-app,位置不限制.在页面上加入了这个执行,那么从当前的元素以 ...

  4. [Angular] Learn Angular Multi-Slot Content Projection

    Now for au-modal component, we pass in tow component though contenct projection: <au-modal class= ...

  5. Docker+Nginx部署Angular

    在部署Angular生产环境之前,需要电脑已经安装docker. 添加Dockerfile在已经完成的Angular项目的项目根目录下添加Dockerfile文件. Dockerfile文件内容: F ...

  6. VS Code直接调试Angular代码

    安装VS Code扩展 安装Debugger for Chrome 安装Debugger for Firefox 配置Launch.json文件 Launch.json文件的创建和生成我们可以利用VS ...

  7. ng-template、ng-content、ng-container

    https://www.jianshu.com/p/0f5332f2bbf8 ng-template.ng-content.ng-container三者应该是自定义组件需要经常用到的指令.今天咱们就来 ...

  8. Jquery使用ajax以及angularjs 动态模板加载并进行渲染

    1. 源码 <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <tit ...

  9. 在Visual Studio 2017中使用Asp.Net Core构建Angular4应用程序

    前言 Visual Studio 2017已经发布了很久了.做为集成了Asp.Net Core 1.1的地表最强IDE工具,越来越受.NET系的开发人员追捧. 随着Google Angular4的发布 ...

  10. .Net Core应用框架Util介绍(一)

    距离上次发文,已经过去了三年半,这几年技术更新节奏异常迅猛,.Net进入了跨平台时代,前端也被革命性的颠覆. 回顾 2015年,正当我还沉迷于JQuery + EasyUi的封装时,突然意识到技术已经 ...

随机推荐

  1. 【转】Apache JMeter web性能测试实例

    Apache JMeter是可以对利用HTTP或FTP服务器的应用程序进行测试的工具.它是基于Java的,通过所提供的API它还具有高度可扩展性.典型的JMeter测试包括创建循环和线程组.循环使用预 ...

  2. java里的MouseLisetener接口的使用过程==========需要用组件是来注册侦听器

    总结:通过匿名类来实现鼠标的监听或者  通过实现接口的方法都可以的 从此是实现MouseListener接口的方式 package com.a.b; import java.awt.Color; im ...

  3. 杂项-公司:联邦快递百科-un

    ylbtech-杂项-公司:联邦快递百科 联邦快递( FedEx)是一家国际性速递集团,提供隔夜快递.地面快递.重型货物运送.文件复印及物流服务,总部设于美国田纳西州,隶属于美国联邦快递集团(FedE ...

  4. elasticsearch pinyin 拼音分词器

    安装pinyin分词 地址:https://github.com/medcl/elasticsearch-analysis-pinyin PUT py_test { "index" ...

  5. nginx keepalive 双机

    Nginx+keepalived双机热备(主从模式)   负载均衡技术对于一个网站尤其是大型网站的web服务器集群来说是至关重要的!做好负载均衡架构,可以实现故障转移和高可用环境,避免单点故障,保证网 ...

  6. stm32下载程序,拔了调试器不能运行程序解决方案

    A:肯定是只拔了仿真器与电脑连接的那端,然后把另外端依然接在板子上.我说的没错吧 B: 对的,这样就会一直复位吗 这是复位的问题,当JLINK在板子上连接的时候,断电情况下,会一直把RESET拉低,导 ...

  7. 19-EasyNetQ:用EasyNetQ.Hosepipe重新提交错误信息

    EasyNetQ.Hosepipe是EasyNetQ队列管理工具.用来取回队列中的消息并重新发布这些消息.还可以用它来检测错误队列,并重试发布消息. 用法 EasyNetQ.Hosepipe.exe ...

  8. const的作用

    const的作用 const是C语言的一种关键字,起受保护,防止以外的变动的作用!可以修饰变量,参数,返回值,甚至函数体.const可以提高程序的健壮性,你只管用到你想用的任何地方. (一)const ...

  9. std:: lower_bound std:: upper_bound

    std:: lower_bound 该函数返回范围内第一个不小于(大于或等于)指定val的值.如果序列中的值都小于val,则返回last.序列应该已经有序! eg: #include <iost ...

  10. laravel使用ORM操作数据库

    laravel使用ORM操作数据库 public function mode(){ //查询所有 $isok=Student::get(); 新增. (1) $isok=Student::create ...