报错现象: 用modal打开某个组件页面时报错 报错:No component factory found for UpdateAuthWindowComponent. Did you add it to @NgModule.entryComponents? 原因: 使用loadChild模式加载对应路由下的组件时,是懒加载模式,即需要的时候才会加载,所以如果路由走的是懒加载模式,需要的module即使在app.module中引入过了,依旧需要再引入一次 解决方案: 在app.module 的e…
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,…
一.组件各部分说明及互相引用 1.一个vue组件由三个部分组成 Template 只能存在一个根元素 2.Script 3.Style scoped:样式只在当前组件内生效 1.1 组件的基本引用代码示例 重点:第1步,app.vue:第2步,father.vue 0.src/main.js // The Vue build version to load with the `import` command // (runtime-only or standalone) has been set…
一.输入属性(父组件与子组件通信) 1. 创建工程 ng new demo1 2.创建order组件 ng g component order 3. 在order组件里定义输入属性 order组件的html 4. 父组件 app.component.ts中定义stock app.component.html, 采用双向绑定 效果图 最终父组件IBM的值,通过输入属性,把值传递给了子组件 二.输出属性(子组件与父组件通信) 1. ng g component priceQutoe 创建报价组件 2…