-
Angular2:CoreModule与SharedModule
所属栏目:[安全] 日期:2020-12-17 热度:57
有人可以解释什么是SharedModule和CoreModule代表什么? 我一直在观察几个使用这种方法的项目,以便建立它的角度项目. 为什么我需要两个模块? 我什么时候应该导入每一个? 每个人应该拥有哪些进口,出口,报关单? TLDR: CoreModule应该只有服务,并且只能在Ap[详细]
-
如何在Angular中使用带有SASS的Bootstrap 4
所属栏目:[安全] 日期:2020-12-17 热度:96
我想在使用Angular CLI创建的Angular(4)项目中使用Bootstrap 4和SASS. 特别是我需要: 使用SASS而不是CSS作为全局样式和组件样式 编译Bootstrap SASS源以及我的自定义* .scss样式 确保我的自定义样式覆盖Bootstrap源,因此我可以在需要时覆盖Bootstrap源,而无[详细]
-
angular – 如何将参数传递给URL内某处的routerLink?
所属栏目:[安全] 日期:2020-12-17 热度:95
我知道我可以将一个参数传递给routerLink以获取路由 /user/:id 通过写作 [routerLink]="['/user',user.id]" 但是这个路线怎么样: /user/:id/details 有没有办法设置此参数或我应该考虑不同的URL方案? 在您的特定示例中,您将执行以下routerLink: [routerLi[详细]
-
angular – formControlName和FormControl有什么区别?
所属栏目:[安全] 日期:2020-12-17 热度:188
我正在使用Angular2的ReactiveFormsModule来创建包含表单的组件.这是我的代码: foo.component.ts: constructor(fb: FormBuilder) { this.myForm = fb.group({ 'fullname': ['',Validators.required],'gender': [] });} foo.component.html(带[formControl][详细]
-
angular – 如何使用ngFor作为字符串数组迭代Typescript Enum
所属栏目:[安全] 日期:2020-12-17 热度:95
我正在使用Angular2和Typscript。我有一个枚举: export enum Role { ServiceAdmin,CompanyAdmin,Foreman,AgentForeman,CrewMember,AgentCrewMember,Customer} 我想使用* ngFor迭代枚举。做这个的最好方式是什么?我必须创建一个管道吗?或者有更简单的方法[详细]
-
角卫,文档中的陈述不清楚
所属栏目:[安全] 日期:2020-12-17 热度:146
我正在努力深入了解角度,所以我读了 the docs,这非常有帮助。 现在我正在研究守卫。我在文档中读到了这个陈述。 The router checks the CanDeactivate and CanActivateChild guards first,from the deepest child route to the top. Then it checks the Ca[详细]
-
loops – Angular 2无法在formArrays上找到带有未指定name属性的
所属栏目:[安全] 日期:2020-12-17 热度:159
我试图迭代我的??组件中的formArray但我得到以下错误 错误:找不到具有未指定名称属性的控件 这是我的类文件中的逻辑 export class AreasFormComponent implements OnInit { public initialState: any; public areasForm: FormGroup; constructor(private fb[详细]
-
dependency-injection – 将类绑定到接口
所属栏目:[安全] 日期:2020-12-17 热度:78
使用typescript,我可以轻松地将类绑定到自己: bootstrap(MyAppComponent,[MyClass]); 但是,我想将我的类绑定到一个接口,如下所示: boostrap(MyAppComponent,[???]); 这样我可以按如下方式注入: class MyAppComponent { constructor(my_class : IMyClas[详细]
-
angularjs – 如何将一些数据从一个控制器传递到另一个控制器[重
所属栏目:[安全] 日期:2020-12-17 热度:73
参见英文答案 AngularJS: How can I pass variables between controllers?15个答案我有以下两个对等控制器。这些没有父母: div data-ng-controller="Controller1"/divdiv data-ng-controller="Controller2" The value of xxx is: {{ xxx }}/divangular.modu[详细]
-
AngularJS ngOptions排序数组
所属栏目:[安全] 日期:2020-12-17 热度:170
我一直在尝试使用ng-options来显示一个字体数组,这些字体按照数组中项目的值按字母顺序排序。 HTML select ng-options="font for font in webfonts | orderBy:'font'" name="fonts" option value=""Choose a font/option/select JS $scope.webfonts = [ 'Ab[详细]
-
由angular-cli 1.0.0构建的Angular 4.0.0 App无法在IE11中运行
所属栏目:[安全] 日期:2020-12-17 热度:180
我尝试在Internet Explorer 11中运行由angular-cli 1.0.0构建的我的处女Angular 4应用程序,但是我没有成功,我收到以下错误: Error: The "apply" property of an undefined or null reference can not be retrieved. 我没有安装额外的库,它只是一个新生成[详细]
-
如何在Angular CLI 6中添加Sass编译:angular.json?
所属栏目:[安全] 日期:2020-12-17 热度:129
我刚刚使用新的Angular CLI 6.0创建了一个新的Angular项目,但我需要将Sass编译添加到我的项目中。我知道你可以在创建项目时设置一个标志,但我的项目已经创建并且已经完成了工作。 使用新Angular CLI生成的新配置文件现在称为angular.json而不是angular-cli[详细]
-
angular – 错误:多个模块匹配.使用skip-import选项跳过将组件
所属栏目:[安全] 日期:2020-12-17 热度:179
当我尝试在角度cli中创建一个组件时,它向我显示此错误.我怎么摆脱它? 我使用角度cli版本:1.4.1 Error: More than one module matches. Use skip-import option to skip importing the component into the closest module. 使用–module参数指定模块. 例如,[详细]
-
Angular2:错误:模块’AppModule’声明的意外值’AppComponent
所属栏目:[安全] 日期:2020-12-17 热度:139
我正在编写 https://angular.io/docs/ts/latest/tutorial/toh-pt2.html的教程并在创建英雄数组后得到以下错误: Error: Error: Unexpected value 'AppComponent' declared by the module 'AppModule' at new BaseException (localhost:3000/node_modules/@an[详细]
-
angularjs – 错误:找不到模块’@ ionic/app-scripts’
所属栏目:[安全] 日期:2020-12-17 热度:157
我是Ionic的新手.我按照Ionic文档“开始”,创建了一个名为“super”的项目示例.问题是当我在项目目录中运行命令行ionic serve时,它会抛出一个错误错误:找不到模块’@ ionic / app-scripts’ 目前与节点6和7兼容的app脚本. 如果你安装了节点8,那么请卸载并安[详细]
-
Angular 2 – 子模块路由和嵌套
所属栏目:[安全] 日期:2020-12-17 热度:90
我正在寻找Angular 2的解决方案,用于下面解释的场景: 在这种情况下,top-nav包含加载子模块的链接,sub-nav有链接来更新子模块的内容. 网址应映射为: / home =在主组件路由器插座中加载主页 / submodule =将子模块加载到主组件路由器插座中,默认情况下应显示[详细]
-
如何使用Rx在Angular 2中实现可拖动的div
所属栏目:[安全] 日期:2020-12-17 热度:120
我一直试图让一个可拖动的div工作使用Angular 2.我使用 this example from the angular2-examples repo作为起点,只是真正调整代码来解释toRx()方法的删除.该代码有效,但它不考虑mouSEOut事件.这意味着如果我单击一个Draggable div,然后慢慢移动鼠标,div将随[详细]
-
Angular2和webpack – i18n插件与ng2-translate
所属栏目:[安全] 日期:2020-12-17 热度:50
我想用angular2构建一个web应用程序,并将其与webpack捆绑在一起. 提供多种语言的最佳方式是什么: i18n-plugin:https://github.com/webpack/i18n-webpack-plugin 要么 ng2-translate:https://github.com/ocombe/ng2-translate 我使用cookbook使用webpack.[详细]
-
AngularJS:如何收听DOM事件?
所属栏目:[安全] 日期:2020-12-17 热度:114
我是AngularJS的新手,请原谅我这个转储问题. 我如何收听’click’或’mousemove’等’dom’事件? 这就是我得到的(没有错误,但也没有导致控制台) //代码基于原始angularjs-seed. angular.module('myApp.controllers',[]). controller('MyCtrl1',['$scope',fu[详细]
-
setCenter无法在angular2-google-maps中工作
所属栏目:[安全] 日期:2020-12-17 热度:150
import { GoogleMapsAPIWrapper } from '@agm/core';import { Component,Input } from '@angular/core';@Component({ selector: 'core-map',styleUrls: [ './map.component.scss' ],templateUrl: './map.component.html',})export class MapComponent { cons[详细]
-
angular – 要求选中复选框
所属栏目:[安全] 日期:2020-12-17 热度:59
我想要一个按钮被禁用,直到使用FormBuilder for Angular检查复选框。我不想显式检查复选框的值,而是希望使用验证器,以便我可以简单地检查form.valid。 在下面的两个验证案例中,复选框都是 interface ValidationResult { [key:string]:boolean;}export cl[详细]
-
在嵌套和重复的angularjs指令中调用链接函数的顺序
所属栏目:[安全] 日期:2020-12-17 热度:85
我对Javascript编程很新,我只涉及AngularJS.为了评估它,我决定编写一个简单的笔记应用程序.模型非常简单,每个音符都有标签,文本和标签列表.但是,我遇到了在隔离的嵌套指令范围之间传递数据的问题. 我有三个指令,注释,注释和标记(定义具有相同名称的新元素).[详细]
-
angular – tslint/codelyzer/ng lint错误:“for(… in …)语句
所属栏目:[安全] 日期:2020-12-17 热度:106
Lint错误消息: src/app/detail/edit/edit.component.ts[111,5]: for (… in …) statements must be filtered with an if statement 代码段(这是一个工作代码.它也可以在angular.io form validation section获得): for (const field in this.formErrors) {[详细]
-
什么是Angular 2模板中的let- *?
所属栏目:[安全] 日期:2020-12-17 热度:78
我在Angular 2模板中遇到了一个奇怪的赋值语法. template let-col let-car="rowData" pTemplate="body" span [style.color]="car[col.field]"{{car[col.field]}}/span/template 似乎let-col和let-car =“rowData”创建了两个新变量col和car,然后可以绑定到模[详细]
-
angular – 何时使用FormGroup与FormArray?
所属栏目:[安全] 日期:2020-12-17 热度:80
FormGroup: A FormGroup aggregates the values of each child FormControl into one object,with each control name as the key. 06000 FormArray: A FormArray aggregates the values of each child FormControl into an array. 06001 应该何时使用另一[详细]
- angularjs – 如何引导数据,因为它是由Angular.j
- 关于央视国际(CCTV.COM)的奥运门户网站的预警
- autoscan、aclocal、autoheader、automake、auto
- unix – PowerShell中的等效时间命令
- Docker结合网络和“内部”属性示例
- angular – 更改检测问题 – 为什么当它与On Pus
- 对于Webservices的超时问题
- webservice 学习笔记,axis2 传递对象数组,非st
- twitter-bootstrap-3 – 如何将bootstrap datepi
- typescript – Angular2 – Http POST请求参数