When i try to compare the string with ng-if from angularjs, i m getting the errors in console.
Below are my data:
value for {{reports[0]}} is:
{"name":null,"discount":0,"margin":0,"reportType":"REPORT_TOP_SELLERS","revenue":0,"variantKey":null,"rank":1,"productKey":"10692-1_en_US","purchasedUnits":0,"abandonedUnits":0}
value for {{reports[0].reportType}} is:
REPORT_TOP_SELLERS
Below are the code which throws the Error:
<div ng-if="{{reports[0].reportType}} === 'REPORT_TOP_SELLERS'">
Error:
Error: [$parse:syntax] Syntax Error: Token '{' invalid key at column 2 of the expression [{{reports[0].reportType}} === 'REPORT_TOP_SELLERS'] starting at [{reports[0].reportType}} === 'REPORT_TOP_SELLERS'].
Please help.