0

I am new to Angular JS and facing parse syntax issue. I am just scratching my head. Tried many solutions but stuck.... Please help me to resolve this issue. Thanks in Advance.

Below is the code:

<tr ng-repeat="Record in Records">
                   <td>
                      <div class="checkbox">
                          <input type="checkbox" id="{{Record.id}}" name="{{'chk_'+Record.id}}" ng-click="{{'Name.changeStatus('+Record.id+',Name.checkStatus'+Record.id+')'" ng-model="{{'Name.checkStatus'+Record.id}}" ng-init="{{'Name.checkStatus'+Record.id}}={{'Name.getTrueFalse('+Record.status+')'}}"  />
                      </div>
                  </td>
                  <td><a href="javascript:void(0)" onaftersave="{{'Name.UpdateRecord('+Record.id+',$data)'}}" ng-model="{{'Name.name'+Record.id}}" editable-text="{{'Name.name'+Record.id}}" e-style="color: #333" e-required ng-init="{{'Name.name'+Record.id}}='{{Record.name}}'" ><span class="{{Record.status == 0 ? 'cross' : ''}}">{{Record.name}}</span></a></td>
                  <td class="right-align"><button type="button" ng-click="Name.deleteRecord(Record.id)" class="btn btn-danger">Delete</button></td>
                </tr>

1 Answer 1

1

Most of your bindings are wrong.

For instance this:

ng-click="{{'Name.changeStatus('+Record.id+',Name.checkStatus'+Record.id+')'"

Should be written:

ng-click="Name.changeStatus(Record.id, Name.checkStatus+Record.id)'"

Basically what you write in ng-click or ng-init are expressions which will be executed by angular. So they shouldn't be string with quotes ' but instead an actual bit a code.

ng-model is a two-ways binding, which means you need to pass a variable here, such as ng-model="myModel" or ng-model="myObject.myProperty"

Too many things are wrong in the code and we cannot guess what you're trying to achieve without the code of the onaftersave and editable-text directives.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.