Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/460.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angularjs/20.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 角度ui网格如何在网格中显示html_Javascript_Angularjs_Angular Ui_Ng Grid - Fatal编程技术网

Javascript 角度ui网格如何在网格中显示html

Javascript 角度ui网格如何在网格中显示html,javascript,angularjs,angular-ui,ng-grid,Javascript,Angularjs,Angular Ui,Ng Grid,我正在尝试在网格中显示html 看着 我最终得到了 var app = angular.module('myApp', ['ngGrid']); app.controller('MyCtrl', function($scope) { $scope.myData = [ {name: "Moroni", age: 50}, {name: "Tia

我正在尝试在网格中显示html 看着

我最终得到了

var app = angular.module('myApp', ['ngGrid']);
            app.controller('MyCtrl', function($scope) {
                $scope.myData = [
                        {name: "Moroni", age: 50},
                        {name: "Tiancum", age: 43},
                        {name: "Jacob", age: 27},
                        {name: "Nephi", age: 29},
                        {name: "Enos", age: 34}
                    ];
                $scope.gridOptions = { 
                    data: 'myData',
                    columnDefs: [
                        {field: 'name', displayName: 'Name'}, 
                        {field:'age', displayName:'Age'}, 
                        {field: 'remove', displayName:'', cellTemplate: '<div class="ngCellText" ng-class="col.colIndex()"><a href="{{row.getProperty(age)}}">Visible text</a></div>'}
                    ]
                };
            });  
var-app=angular.module('myApp',['ngGrid']);
应用程序控制器('MyCtrl',函数($scope){
$scope.myData=[
{姓名:“莫罗尼”,年龄:50},
{姓名:“Tiancum”,年龄:43},
{姓名:“雅各布”,年龄:27},
{姓名:“尼菲”,年龄:29},
{姓名:“埃诺斯”,年龄:34}
];
$scope.gridOptions={
数据:“myData”,
columnDefs:[
{字段:'name',显示名称:'name'},
{字段:'age',显示名称:'age'},
{字段:'remove',显示名称:'',单元格模板:'}
]
};
});  
但它不起作用(href属性为空) 那么正确的方法是什么呢? 再见

在href中试试这个


{{row.getProperty(\'age\')}

它就像一个charme:)只需一点转义行就可以了。getProperty(\'age\')太好了,我也修复了我的答案:)我想知道为什么-1!另一个回答不起作用!如果URL中有角,我总是使用
ng href
来代替
href
。。。