Saturday, 15 August 2015

javascript - AngularJS: render table columns before content is received -


How do I properly assign table columns before receiving AngularJS material required for them?

I'm using ng-if to show content, since I need different elements depending on the value coming back from the API call, see below ng- This is the only reason for not using the bind, which I think it would be a more legitimate solution.

  & lt; Td ng-if = "someArray.length> 0" & gt; & Lt; A ng- href = "some links" & gt; Yes & lt; / A & gt; & Lt; / Td> & Lt; Td ng-if = "someArray.length == 0" & gt; No & lt; / Td>  

Using it, due to obvious reasons, special columns are not shown at all, whereas someArray is not started I have another ng-if undefined in code>, but while waiting for the value I will have the column completely empty. I'm still quite new in the AngularJS and I think there is a best practice here.

You can use ng-in the internal door elements

 < Code> & lt; Td> & Lt; A ng-if = "someArray.length & gt; 0" ng- href = "some links" & gt; Yes & lt; / A & gt; & Lt; P ng-if = "someArray.length == 0" & gt; No & lt; / P & gt; & Lt; / TD & gt;  

No comments:

Post a Comment