Being new to AngularJS, I am trying to grasp the error messages displayed in the console. Below are my JSON object and other details for reference.
In the JSP page:
<body id="bodyID" ng-controller="ApplicationParameterController" >
<div ng-cloak class="ng-cloak">{{init(${displayInfo})}}</div>
<toaster-container toaster-options="{'time-out': 3000}"></toaster-container>
<application-param></application-param>
</body>
My JSON object:
displayInfo = [{"id":34,"key":"a","value":"true","description":"a","privilege":{"privilegeID":77,"privilegeCode":"app_param_admin"}},{"id":35,"key":"summaryReportEmail","value":"<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="582c3d2b2c183f35393134763b37353148743b3e">[email protected]</a>","description":"summaryReportEmail","privilege":{"privilegeID":77,"privilegeCode":"app_param_admin"}},{"id":36,"key":"b","value":"true","description":"b","privilege":{"privilegeID":77,"privilegeCode":"app_param_admin"}},{"id":1,"key":"T_AND_C_ON","value":"Y","description":"c","privilege":{"privilegeID":74,"privilegeCode":"enable_tnc"}},{"id":3,"key":"soapAddress","value":"http://test.com/test/test.asmx","description":"soapAddress","privilege":{"privilegeID":77,"privilegeCode":"app_param_admin"}},{"id":4,"key":"soapAddressAlter","value":"http://test.com/test/test.asmx","description":"soapAddressAlter","privilege":{"privilegeID":77,"privilegeCode":"app_param_admin"}},{"id":27,"key":"d","value":"d","description":"d ","privilege":{"privilegeID":77,"privilegeCode":"app_param_admin"}},{"id":28,"key":"sts.s3.bucket.name","value":"test01-sts-healix-xmls","description":"sts.s3.bucket.name","privilege":{"privilegeID":77,"privilegeCode":"app_param_admin"}},{"id":29,"key":"e","value":"e","description":"e","privilege":{"privilegeID":77,"privilegeCode":"app_param_admin"}},{"id":30,"key":"f","value":"f/g","description":"f","privilege":{"privilegeID":77,"privilegeCode":"app_param_admin"}},{"id":31,"key":"g","value":"7","description":"g","privilege":{"privilegeID":77,"privilegeCode":"app_param_admin"}},{"id":32,"key":"enableScheduler","value":"true","description":"enableScheduler","privilege":{"privilegeID":77,"privilegeCode":"app_param_admin"}},{"id":33,"key":"sts.document.api","value":"http://www.test.com/as-da-api","description":"sts.document.api","privilege":{"privilegeID":77,"privilegeCode":"app_param_admin"}}]
I am encountering the following error:
Error: [$parse:syntax] http://errors.angularjs.org/1.3.0-beta.14/$parse/syntax?p0=undefined&p1=is%20unexpected%2C%20expecting%20%5B%7D%5D&p2=null&p3=init(%5B%7...G/<@https://localhost:8443/travelinsurance-aggregator/resources/scripts/angular.min.js:6:457
The init method I am using is:
$scope.init = function(displayInfo) {
if ($scope.displayInformation == null || $scope.displayInformation == 'undefined') {
$scope.displayInformation = angular.fromJson(displayInfo);
$scope.applicationParameters = $scope.displayInformation;
}
};
Despite no syntax errors being detected by json formatter, an error message stating otherwise is persisting. After researching various sites, I was unable to find a solution for this error.
- Stackoverflow link
- Angularjs link
If anyone can offer guidance on resolving this issue, it would be greatly appreciated. Thank you in advance.