0

I am presenting a separate div based on if condition inside ng-repeat. but it throws an error saying " Syntax Error: Token '<' not a primary expression at column 32 of the expression [widget.Type == 'Bar'>". How can i fix it?

here is my code,

HTML:

  <div   id="main"  class="drop-container" ng-click="addEvent($event)" droppable>
    <div ng-controller="CustomWidgetCtrl"  style="margin: 20px; top: 50px; left: 80px; height: 300px; width: 500px; " ng-repeat="widget in dashboard.widgets" ng-style="{ 'left':widget.sizeX, 'top':widget.sizeY }"
    data-identifier="{{widget.id}}">
    <div class="box" >
        <div class="box-header" >
        <h3>{{ widget.name }}</h3>
    <div class="box-header-btns pull-right">
    <a title="settings" ng-click="openSettings(widget)"><i class="glyphicon glyphicon-cog"></i></a>
    <a title="Remove widget" ng-click="remove(widget)"><i class="glyphicon glyphicon-trash"></i></a>
    </div>
    </div>
    <div ng-if="widget.Type == 'Bar'>
      <body ng-controller="MainCtrl">  <div  data-ac-chart="'Bar'"  data-ac-data="data" data-ac-config="config"  class="chart">
      </div>
    </body>
    </div>
    </div>
    </div>
    </div>
1
  • 1
    there should be an extra quote after 'Bar' in ng-if condition. Commented Dec 24, 2014 at 6:30

1 Answer 1

2

there is an syntax error, you are missing closing double quotation mark in ng-if so it is reaching next html tag

<div ng-if="widget.Type == 'Bar'">
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.