草庐IT

angular_removal

全部标签

javascript - Angular UI-Router 在具有 go 函数的状态之间传递数据不起作用

我刚开始学习angularjs,我正在使用angular-ui-router。我正在尝试使用$state.go将数据从一种状态发送到另一种状态,但没有成功。这是我目前所拥有的:我没有故意包含html,因为我认为不需要它,如果需要请告诉我,我会添加它。我的状态配置如下:$stateProvider.state('public',{abstract:true,templateUrl:'App/scripts/main/views/PublicContentParent.html'}).state('public.login',{url:'/login',templateUrl:'App/s

javascript - ui-bootstrap(Angular.JS)中选项卡的淡入淡出效果

如何使用angular-ui-bootstrap将淡入淡出动画添加到标签集中?例如,给定以下代码:SomecontentOthercontent我希望选项卡的内容在它们之间切换时淡出。我尝试将fade类添加到tab标签(类似于您对bootstrap3js文件的处理方式),但没有成功。非常感谢! 最佳答案 自从使用tabsetng-class控制“事件”选项卡,这允许我们通过在删除/附加“事件”类时设置opacity=0来定义带有Angular动画的淡入淡出效果。首先,你需要加载ngAnimate包含angular-animate.j

javascript - Angular 将文件另存为 csv 导致失败 - 网络错误仅在 Chrome 上

我正在使用以下代码将文件保存为csv。$scope.saveCSVFile=function(result){vara=document.createElement('a');a.href='data:application/csv;charset=utf-8,'+encodeURIComponent(result.data);a.target='_blank';a.download=$scope.getFileNameFromHttpResponse(result);document.body.appendChild(a);a.click();$scope.isReportInPro

javascript - 错误 TS7017 : Index signature of object type implicitly has an 'any' type in form validation angular 2

我在给出的Angular2中进行响应式(Reactive)验证时遇到编译错误errorTS7017:Indexsignatureofobjecttypeimplicitlyhasan'any'type为了this.comErrors[field]='';constmessages=this.validationMessages[field];this.comErrors[field]+=messages[key]+'';它正在按应有的方式运行,但是当我尝试运行npmrunbuild.prod时,出现错误并且无法构建我的项目这是我的代码:onValueChanged(data?:any)

javascript - 为什么这个 Angular Controller 会抛出 "Error: Unknown provider: nProvider <- n"?

jsFiddleofthecode:{{data.message+"world"}}functionFirstCtrl($scope){$scope.data={message:"Hello"};}我刚刚开始使用Egghead.io上的视频学习Angular。跟着我被困在2ndvideowhereJohndiscussescontrollers上.它在他的视频中有效,在我的机器上失败。代码太基础了,我不知道是什么引发了这个错误:>Error:Unknownprovider:nProvideratError()>athttp://cdnjs.cloudflare.com/ajax/lib

javascript - 如何将onclick函数中的angular js变量作为参数传递

我尝试将AngularJS变量作为参数值传递给onclick()以调用javascript函数。谁能指导我如何操作?我的代码:{{filterList.id}} 最佳答案 你应该使用ng-click,没有理由使用onclick,因为angular为你提供了这个功能{{filterList.id}}然后你应该将你的函数移动到你的AngularJSController中,并将它绑定(bind)到作用域$scope.deleteArrival=function(filterListId){...};如果你绝对需要使用onclick来调用外

javascript - 在 Angular2 上向正文添加类

我有三个组成部分。它们是HomeComponent、SignInComponent和AppComponent。当应用程序打开时显示我的主页(HomeComponent)。我在登录页面打开时单击了“登录”按钮。我希望在打开它时将“登录页面”类添加到正文中。我该怎么做?//AppComponentimport{Component}from'@angular/core';@Component({moduleId:module.id,selector:'app',template:''})exportclassAppComponent{}//SignInComponentimport{Comp

javascript - Angular 4 : how do access local json?

在Angular2中,你可以有一个文件夹/data/和一个json文件,你可以在localhost:4200/data/something.json访问它。这在Angular4中不再可能。知道如何让它工作吗? 最佳答案 你可以使用这个代码@Injectable()exportclassAppServices{constructor(privatehttp:Http){varobj;this.getJSON().subscribe(data=>obj=data,error=>console.log(error));}publicget

javascript - 找不到名称 +'Input'。任意 Angular 2

我正在尝试让@Input在Angular2中使用Typescript。我收到以下错误,我不明白为什么。[ts]Cannotfindname'Input'.any下面是该组件的代码。import{Component,OnInit}from'@angular/core';@Component({selector:'app-item',templateUrl:'./app-item.component.html',styleUrls:['./app-item.component.css']})exportclassAppItemComponentimplementsOnInit{@Input

javascript - Chart.js 条形图 : How to remove space between the bars in v2. 3?

我正在尝试删除条形图条之间的空间,但即使我在很多地方看到这个解决方案,它也不适合我。Chart.js文档中也没有提到它,所以这很奇怪。谁能告诉我如何指定它?varoptions={barValueSpacing:1,//doesn'twork;findanotherwaybarDatasetSpacing:1,//doesn'twork;findanotherwaylegend:{display:false//Hidesannoyingdatasetlabel},tooltips:{callbacks:{label:function(tooltipItem){returntooltip