javascript - ng-repeat using scope function return value not calling function -
I'm having trouble using the return value of the function because ng-repeat in a custom command.
The code is very simple:
. Directional ('triro', [function] {return function created () {var treeController; return (restriction: 'e' is required: '^ treegrid', radius: {line: '='}, template url: 'components / TreeGrid / template / line.html.html, link: function (area, element, etter, grid controller) {tree controller = grid controller;}, controller: function ($ scope) {$ scope.getColumnDefinitions = function () {return treeController Template: ; Td ng-repeat = "getColumnDef Columns in inions (columns) & gt; {{row [column.key]}} & lt; / td> & lt; / tr & gt;
debugger usage By doing, the getColumnDefinitions
function is never actually called in the template, inspecting the code, the function is present.
Just fine, however it works in the template: < / P>
& lt; T & gt; TD & gt; {{getColumnDefinitions ()}} & lt; / TD & gt; & lt; / tr & gt;
Use NG-Init to assign a return value to a floating variable Does not call.
Adding data directly to the radius does not work either:
link: function (scope, element, etter, grid controller) {tree controller = grid controller; Scope.columnDefinitions = gridController.getColumnDefinitions (); },
This instruction is part of another NG-repeat, which is used as:
& lt; Tree-row ng-repeat = "row in data" row = "row" & gt; & Lt; / Tree-line & gt;
Update
Obviously this is an issue with the td
element instead of a div By changing the element, it works fine: & lt; Tr & gt; & Lt; Div ng-repeat = "column in getColumnDefinitions ()" & gt; {{Row [column.key]}} & lt; / Div & gt; & Lt; / TR & gt;
Using angular.js 1.3. *.
Any suggestions / suggestions are welcome, thanks :)
Comments
Post a Comment