I have code like this:
You can better add the following table-html to your template like this:
菜名 单价 份数 小计
{{name}}
{{price}}
{{num}}
{{total}}
Ng-Repeat will render the necesarry table rows for every item in your obj variable. After that you will need to define $scope.obj
in your controller since your angular app will look for that. I think that just definig var obj
is not working, but I have never used it that way.