-
angular – 如何捕获Material Design md表中的选定表行
所属栏目:[安全] 日期:2020-12-17 热度:124
我有一个要求,我应该能够捕获所选行[用户可以点击该行的任何地方].我浏览了文档 https://material.angular.io/components/table/overview,但我找不到捕获所选行及其内容的方法.我试图附加一个点击事件 md-table标签,但它没有用. md-table #table [dataSource[详细]
-
Angular 4错误:类型'()=> any’中缺少属性’includes’
所属栏目:[安全] 日期:2020-12-17 热度:148
我在使用angular 4和observable时遇到错误. /Users//backend/src/app/app.component.ts(15,55):输入'()=任何’不能分配给’State []’. /Users//backend/src/app/app.component.ts(15,55):输入'()=任何’不能分配给’State []’. ‘()=类型中缺少属性’inc[详细]
-
angular – XHR错误(404 Not Found)加载http:// localhost:300
所属栏目:[安全] 日期:2020-12-17 热度:194
当我在代码中尝试使用Angular Material时,我遇到了以下错误. zone.js:101 GET http://localhost:3000/traceur 404 (Not Found)scheduleTask @ zone.js:101ZoneDelegate.scheduleTask @ zone.js:345Zone.scheduleMacroTask @ zone.js:282(anonymous function)[详细]
-
angularjs – 我如何在测试量角器时提供“rootelement”选项
所属栏目:[安全] 日期:2020-12-17 热度:132
当我执行node elementexplorer.js http://127.0.0.1:8080/app/view1时 我收到以下错误: There was a webdriver error: Error Error while waiting for Protractor to sync with the page: “root element (body) has no injector. this may mean it is not[详细]
-
typescript – Angular 2中的`change`事件是什么
所属栏目:[安全] 日期:2020-12-17 热度:118
Angular 2中的变化事件是什么?什么时候发送,我该如何使用它? I. e.通过(change)=“update()”在以下代码中订阅了什么? http://plnkr.co/edit/mfoToOSLU6IU2zr0A8OB?p=preview import {Component,View,Input,Output,EventEmitter,OnChanges} from '@angula[详细]
-
angular – 错误:找不到加载’ProfileDetailsComponent’的主要
所属栏目:[安全] 日期:2020-12-17 热度:100
我正在尝试在我的应用程序中使用路由,使用路由器版本3.0.0-beta.1,应用程序正在运行,但是当我点击subjects.component.html中的“下一步”按钮时,我期待获得’的内容’ profileDetails.component.html”.我创造了一个plunkr例如.这里: http://plnkr.co/edit/[详细]
-
angularjs – 如何清除离子中的本地存储数据?
所属栏目:[安全] 日期:2020-12-17 热度:143
这是我的代码. $scope.logout=function(){ localstorage.set('user_id',""); localstorage.set('access-token',""); localstorage.set('isUserTraverseColony',0); localstorage.set('isStarted',0); $window.localStorage.clear(); $window.localStorage.re[详细]
-
使用ui-router时,AngularJS可能无法处理拒绝
所属栏目:[安全] 日期:2020-12-17 热度:157
在我从ngRoute更改为angular-ui-router后,控制台始终显示4个错误说明:可能未处理的拒绝:{} 我没有注意到我正在构建的应用程序的行为有任何“问题”,但我想摆脱它. 知道它是什么意思以及如何解决它? 这是一个截图: 此问题可在1.5.9和1.6.0-rc-0中找到. 更[详细]
-
AngularJS $http.get with resolve
所属栏目:[安全] 日期:2020-12-17 热度:65
我开始了解AngularJS,我有一个有趣的问题.我开始了解routeProvider,我想我可以编写我的应用程序,就像你搜索一个表名一样,它会改变路由,所以你也可以在url之后写表. 来自app.js的详细信息 app.config(function($routeProvider){ $routeProvider .when('/',{ t[详细]
-
Angular 2 – 订阅FormControl的valueChanges是否需要取消订阅?
所属栏目:[安全] 日期:2020-12-17 热度:147
以下是我所询问的一个简单示例: class AppComponent { someInput: FormControl = new FormControl(''); private subscription: Subscription; constructor(){ this.subscription = this.someInput.valueChanges .subscribe(() = console.log("testing")); }[详细]
-
angularjs – 如何将角度ui-mask上的autoclear设置为false?
所属栏目:[安全] 日期:2020-12-17 热度:71
我目前有一个带有手机ui-mask的输入.如果输入的值不是掩码的全长,则清除输入.有没有办法设置ui-mask,以便在点击或失去焦点时不清除输入? input ui-mask="(999) 999-9999" type="text"/ 您可以设置ui-options属性来设置选项: input ui-mask="(999) 999-9999[详细]
-
Angular4组件继承与抽象类
所属栏目:[安全] 日期:2020-12-17 热度:57
我想为我的组件定义一个基类来共享一些功能.所以我开始: export abstract class BaseComponent { protected getName(): string;}@Component(...)export class MyComponent extends BaseComponent { protected getName(): string { return "MyComponent"; }}[详细]
-
angularjs – 有条件地注入角度模块依赖性
所属栏目:[安全] 日期:2020-12-17 热度:75
我是角度新手并拥有以下代码. angular.module('MyApp') .controller('loginController',['$scope','$http','conditionalDependency',function ($scope,$http,conditionalDependency{} 我想有条件地加载conditionalDependency.像这样的东西 if(true){//add co[详细]
-
从Angular 4中的选择选项中获取价值
所属栏目:[安全] 日期:2020-12-17 热度:113
如何从Angular 4中的select选项中获取值? 我想将它分配给component.ts文件中的新变量.我试过这个,但没有输出任何东西. 你也可以用[(ngModel)]来做吗? component.html form class="form-inline" (ngSubmit)="HelloCorp(f)" #f="ngForm" div class="select"[详细]
-
angular2 NgFor仅支持绑定到诸如Arrays之类的Iterables
所属栏目:[安全] 日期:2020-12-17 热度:154
Angular2 rc.6 在json数据上运行循环时出现以下错误 core.umd.js:5995 EXCEPTION:app / modules / mbs / components / menu.html:5:4引起的错误:无法找到’object’类型的不同支持对象'[object Object]’. NgFor仅支持绑定到诸如Arrays之类的Iterables.[详细]
-
Angular 2:如何使用[routerLink]提供插值
所属栏目:[安全] 日期:2020-12-17 热度:57
我以这种方式在routing.ts文件中定义了路由. const routesapp: Routes= [{path:'user/id',component:UserComponent}];export const:routing ModuleWithProviders = RouterModule.forRoot(routesapp,{useHash:true}); 并以HTML格式 li class ="Some class" a[详细]
-
angularjs – 在测试angular指令时,isolateScope()返回undefined
所属栏目:[安全] 日期:2020-12-17 热度:200
使用Angular v1.2.25和rails资产管道,我试图测试指令的隔离范围确实已经更新.由于isolateScope()返回undefined我得到预期未定义的定义…’ describe("cool directive",function() { beforeEach(module('necessaryModule')); var scope,$rootScope,$compile,e[详细]
-
angularjs – Angular:$apply已经在IE11中进行,但在FF和Chrome
所属栏目:[安全] 日期:2020-12-17 热度:124
我有一个 input type="file" id="aircraftList" name="aircraftList" file-upload multiple/ 绑定到指令 angular.module("app.directives").directive('fileUpload',function () { return { scope: true,link: function (scope,el,attrs) { el.bind('change'[详细]
-
angularjs – 更新数组时如何避免刷新ng-repeat DOM列表
所属栏目:[安全] 日期:2020-12-17 热度:173
我正在构建一个邮件系统的前端.它很好地分散在控制器和服务中.我正在使用$interval检查新邮件,这些邮件以 JSON格式收到,并添加到模型中. 所有内容都很好地呈现在屏幕上,复选框选择邮件删除和按钮等… 问题是,当一个人正在做出选择时 – $interval将检查新邮[详细]
-
angular – 使用hasError()进行验证的表单生成器抛出错误ERROR T
所属栏目:[安全] 日期:2020-12-17 热度:139
嗨,我正在使用表单生成器在角度2中实现一个表单 在component.ts中,我使用formGroup实现了我的表单 以下是我的代码 public myForm: FormGroup;constructor(private authenticateservice: AuthenticateService,private _fb: FormBuilder ) {}ngOnInit() {this.[详细]
-
Angular 2 Material md-chips颜色属性不起作用
所属栏目:[安全] 日期:2020-12-17 热度:127
当我尝试使用颜色属性设置我的md-chips样式时没有任何反应.根据指南 https://material.angular.io/components/component/chips,这必须工作.我的所有其他元素都没有问题. md-chip-list md-chip color="primary" Chicken /md-chip md-chip color="warn" Table[详细]
-
angular – @Input和其他装饰器和继承
所属栏目:[安全] 日期:2020-12-17 热度:93
我真的不明白对象绑定是如何工作的,所以如果有人能解释我是否可以在基类中使用@Input(),或者更好:装饰器和继承. 例如,如果每个表单都应该接收一个客户,我有一个基类: export class AbstractCustomerForm{@Input() customer;...} 然后我在实际组件中扩展此[详细]
-
angularjs – 未捕获错误:无模块:ngRoute
所属栏目:[安全] 日期:2020-12-17 热度:54
我正在使用ngRoute模块,但它显示我的错误,因此有额外的文件需要添加使用此模块我搜索但我没有发现像其他模块资源,我们需要单独的文件的cookie我是否为ngroute也如果是的话所以在哪里我能找到这个吗? 错误:- Uncaught Error: No module: ngRoute var app =[详细]
-
Angular 2模板 – 方法的安全导航操作符
所属栏目:[安全] 日期:2020-12-17 热度:67
我正在成功使用angular 2安全导航操作符作为属性,文档说明属性路径,但方法路径的最佳方法是什么? myObj?.myMethod().myProperty 给出例外: EXCEPTION: TypeError: Cannot read property ‘myProperty’ of null in [{{myObj?.myMethod().myProperty}} 在ja[详细]
-
Angular 2将焦点设置在组件加载的第一个表单字段上
所属栏目:[安全] 日期:2020-12-17 热度:142
在我的应用程序中,我想在组件加载时自动将焦点放在表单的第一个字段上.任何人都可以指导如何实现这一点而不重复,因为我想在我的应用程序中的每个表单(活动表单)上. 您应该使用指令来实现此行为. 这将告诉你如何做到这一点:https://plnkr.co/edit/ttxCP7vCLk[详细]