草庐IT

ng2-dragula

全部标签

javascript - Ng2-Charts Linechart 仅显示前 2 个值

我正在开始使用Angular-CLI(beta22.1)初始化的新Angular应用程序。但是当我将测试数据(5个值)添加到我的图表时,它似乎缩放错误并且只显示前两个值并将它们拉伸(stretch)到图表的整个长度(见图)。该项目在其他方面是空白的,不包含任何CSS。我的app.component.html:app.component.tsimport{Component}from'@angular/core';import{BaseChartDirective}from"ng2-charts/ng2-charts";@Component({selector:'app-root',te

javascript - 让 ng-repeat 在 AngularJS 的 $interpolate 服务中工作

我正在使用Bootstrap的AngularJs-UI组件。我想将一个填写好的模板插入弹出框功能的数据元素之一。这适用于查找不在ng-repeat内的所有元素。如何让ng-repeat元素在内插模板中工作?我在http://plnkr.co/edit/Cuku7qaUTL1lxRkafKzv有一个plunker它不起作用,因为我不知道如何在plunker中获取Angular-UI-bootstrap。somecontent我的本​​地作用域具有函数createHTML(),看起来像这样。angular.module('myApp',['ngSanitize']).controller(

javascript - ng2-translate (404 not found) 我已经在 system.js 中添加了

我已将ng2-translate安装到我的项目中,但控制台错误一直显示404包和xhr错误。我已将ng2-translate添加到标准angular2quickstart附带的system.config.js,但仍显示404和xhr错误。它要么给我404错误,要么给出未定义错误的注释:/github:关于使用systemconfig.js的问题的线程https://github.com/ocombe/ng2-translate/issues/167varmap={'app':'app',//'dist','@angular':'node_modules/@angular','angul

javascript - 嵌套 ng-bootstrap 选项卡(Angular 2)

我正在尝试嵌套ng-bootstrap选项卡小部件,但嵌套选项卡的内容未正确显示。当我点击嵌套选项卡时,内容本身就会消失。Minimaldemo我做错了什么?这是View代码:{{tab.title}}{{tab.content}}112233 最佳答案 更新Angular4.3.6包含针对此问题的修复。https://github.com/ng-bootstrap/ng-bootstrap/issues/1433#issuecomment-325104017以前的版本这是一个错误。可能的解决方法可能是使用额外的模板,例如:{{ta

javascript - 为 angular 1.1.x 中的 ng-repeat 编写的过滤器的 $digest 迭代错误

我一直在考虑尝试编写过滤器,但它非常令人沮丧。以下是我为编写“block”过滤器而遵循的一些资源https://groups.google.com/forum/#!topic/angular/IEIQok-YkpUhttps://groups.google.com/forum/#!topic/angular/gEv1-YV-Ojg我试了一下,成功了。但发现版本之间的行为存在差异所描述的生成$$hashKey的方法在1.1.5版本中不起作用。第一个fiddle很好,而第二个fiddle产生迭代错误,即使代码完全相同:http://jsfiddle.net/nRGTX/38/-1.0.3版

javascript - AngularJS ng-style 不随属性改变

我似乎无法弄清楚为什么样式属性没有更新。在我较大的应用程序中,它似乎工作正常。angular.module('Model',[]).factory('SizeModel',function(){return{width:200,height:100,display:"block",getCombined:function(){returnparseInt(this.width)+parseInt(this.height);}};});functionAlbumCtrl($scope,SizeModel){$scope.master=SizeModel;$scope.$watch("ma

javascript - Angularjs 表排序与 ng-repeat

我有一个HTML表格,想通过单击表格标题($scope.headersinctrl)对我的记录($scope.recordsinctrl)进行排序,谁能解释一下为什么会这样:{{headers[0]}}{{headers[1]}}但事实并非如此:{{headers[$index]}}这是记录的代码:我的表格中有58列,因此循环遍历表格标题会好得多... 最佳答案 正如David所建议的,这可能与范围相关。自ngRepeat创建一个新范围您的ngClick正在为每个列标题在其自己的子范围中设置sortColumn和reverse。解决

javascript - 用于复选框上 ng-indeterminate 属性的 AngularJS 自定义指令

这是一个处理复选框不确定状态的指令:.directive('ngIndeterminate',function(){return{restrict:'A',link:function(scope,element,attributes){attributes.$observe('ngIndeterminate',function(value){$(element).prop('indeterminate',value=="true");});}};})然后,例如使用这些数据:$scope.data=[{name:'foo',displayed:2,total:4},{name:'bar'

javascript - 使用 ng-hide 不显示 Angular 模板

我有一个用于放置按钮表单的AngularDirective(指令)。在用户需要看到它之前,模板是隐藏的。这是一个简单的模板,可以单独使用,但是当我将它组合成更大的形式时,模板不会出现。这是指令:.directive('buttonToggle',function(){return{restrict:'A',scope:{myBtnArr:"="},template:'{{myBtnTxt[myBtnArr]}}',link:function(scope){scope.myBtnTxt=["AND","OR","NOT"];scope.click=function(){scope.myB

templates - 在 Go 服务器 : download fail 上加载 Angular2 Bootstrap 模板 ng2-admin

我是这个论坛的新手,也是Angular2和Golang的新手。我的问题是我想尝试template在Go服务器上。因此,我创建了一个包含此main()函数的main.go文件:funcmain(){r:=mux.NewRouter()p:=http.StripPrefix("/",http.FileServer(http.Dir("./src/")))n:=http.StripPrefix("/config",http.FileServer(http.Dir("./config/")))r.PathPrefix("/config/").Handler(n)r.PathPrefix("/"