Syntax error on data-target in ReactJS - reactjs

I am completely new to ReactJS and I 'm working on existing app, there I found some error in the line
<span data-toggle="modal" data-target="'#'+{providers.TICKET_NUMBER}">
{providers.TICKET_NUMBER} </span>
The error displaying is "jquery-1.10.2.min.js:21 Uncaught Error: Syntax error, unrecognized expression: '#'+{providers.TICKET_NUMBER}
Kindly please help,if possible. Excuse mistakes,If any.

You need to put the expression in a pair of {}
data-target={"#" + providers.TICKET_NUMBER}>

Related

angular [$parse:ueoe] Unexpected end of expression

I am very new in Angular.. I tried to bind ng-init from the data that I get from ASP.NET codebehind..
The code looks like this:
<div class="ki-component" ng-app ng-init="init(<%= GetSmallCartData(3) %>)">
However I got an error "[$parse:ueoe] Unexpected end of expression". Here is more details
Error: [$parse:ueoe] Unexpected end of expression: init([{
http://errors.angularjs.org/1.6.6/$parse/ueoe?p0=init(%5B%7B
at angular.js:117
at AST.peekToken (angular.js:15278)
at AST.object (angular.js:15219)
at AST.primary (angular.js:15137)
at AST.unary (angular.js:15125)
at AST.multiplicative (angular.js:15112)
at AST.additive (angular.js:15103)
at AST.relational (angular.js:15094)
at AST.equality (angular.js:15085)
at AST.logicalAND (angular.js:15077) "<div class="ki-component ng-scope" ng-app="smallBasket" ng-controller="smallBasketCtrl" ng-init="init([{" _customermaterialnumber":null,"_internallistprizetotal":null,"_prizediscount":null,"_prizeperunit":null,"itemid":null,"mdmaterialnumber":null,"customermaterialnumber":null,"quantity":"1","quantityasked":null,"mddescription":"k="" 7="" premium="" full="" control="" plus="" home="" *eu","mdadditionaldescription":null,"freegood":null,"tdlistprice":null,"netprice":null,"grossprice":null,"requestdatebyuser":null,"deliverableonuserdate":false,"deliverydatebysystem":null,"orderitemschedules":null,"picture":"https:="" d6mbshfzr0ulu.cloudfront.net="" pro="" ad2ede993af5d4cb1dc6da428e12bcc5.jpg","mdweightunit":null,"mdformatedarticleid":"1.317-133.0","mdean":null,"mddimensions":null,"mdpackagesize":null,"mdgrossweight":null,"mdpackageunit":null,"mdpalletsize":null,"mdclassification":null,"mdgrossweightunit":null,"mddangerousgood":false,"mdcompvolume":null,"mdcompvolumeunit":null,"mdvolume":null,"mdvolumeunit":null,"tdcurrencycode":null,"tdstock":null,"tdcountryoforigin":null,"tdhazardclassification":null,"tdunit":null,"conflict":false,"conflicttest":false,"newitem":false,"matchpalletsize":true,"recommendedcountforpallet":0,"shippingpoint":null,"enablearticlenr":false,"enablecustomermatnr":false,"palletquantity":null,"palletsize":null,"palletstackfactor":null}])"="">"
Can anyone help me why I got this error and how I should fix this?
Many Thanks

Angular? throwing unexpected token because of less?

I'm using:
JSPM, SystemJS and Angular
I can't import less files without running into a series of errors:
Error: [$parse:syntax] Syntax Error: Token 'text' is an unexpected token at column 8 of the expression [status text] starting at [text].
http://errors.angularjs.org/1.5.0/$parse/syntax?p0=text&p1=is%20an%20unexpected%20token&p2=8&p3=status%20text&p4=text
at eval (http://localhost:8002/jspm_packages/npm/angular#1.5.0/angular.js:68:12)
at Object.AST.throwError (http://localhost:8002/jspm_packages/npm/angular#1.5.0/angular.js:13816:11)
at Object.AST.ast (http://localhost:8002/jspm_packages/npm/angular#1.5.0/angular.js:13586:12)
at Object.ASTCompiler.compile (http://localhost:8002/jspm_packages/npm/angular#1.5.0/angular.js:14040:31)
at Parser.parse (http://localhost:8002/jspm_packages/npm/angular#1.5.0/angular.js:14927:29)
at $parse (http://localhost:8002/jspm_packages/npm/angular#1.5.0/angular.js:15035:39)
at $interpolate (http://localhost:8002/jspm_packages/npm/angular#1.5.0/angular.js:11770:25)
at addTextInterpolateDirective (http://localhost:8002/jspm_packages/npm/angular#1.5.0/angular.js:9282:27)
at collectDirectives (http://localhost:8002/jspm_packages/npm/angular#1.5.0/angular.js:8350:11)
at compileNodes (http://localhost:8002/jspm_packages/npm/angular#1.5.0/angular.js:8145:22) undefined
I've read a lot online and found that for some people it was the encoding of the file, but I've tried several things including the one below with no luck:
#charset "utf-8";
/* CSS Document */
Any ideas why is that happening?
Please, let me know if there are any parts of my code that could be of help.
EDIT:
Thanks!
The problem was a comment!! I have no idea why, but Angular was trying to parse the comment:
/*
---------------------------------------
A status badge.
---------------------------------------
Usage:
<span class="badge badge-status">
{{status text}}
</div>
---------------------------------------
*/
I solved it by removing the comment.

Error: [ngRepeat:iexp] Expected expression in form of '_item_ in _collection_[ track by _id_]' but got '\"movie'

I'm trying to test my Rails/Angular app in production Rails server and I'm getting an error in my console I don't know how to fix.
The error is,
Error: [ngRepeat:iexp] Expected expression in form of '_item_ in _collection_[ track by _id_]' but got '\"movie'.
The line of code,
%li.animate-repeat.search_results{"ng-if" => " movie.poster_path && movie.release_date", "ng-repeat" => "movie in movieList | orderBy:'-release_date'"}
The error is resolved when I remove the | orderBy:'-release_date' but obviously that's a filter I need.
Is there a good reason why this error is occuring?
You should check very well , all ng-repeats , specially if you have more than one ng-repeat within your page, I had the same error until I scan through my code carefulyl and found the issue
I read this from Here

Syntax error in order() method using ng-click and ng-repeat

I am using the following html code to create an ng-repeat:
<td ng-repeat="parentCategory in totalParentCategoriesCount | orderBy :'-Count'">
<h3>
Kategori
<span class="sortorder" ng-show="predicate === 'CategoryParent{{parentCategory.Count}}'" ng-class="{reverse:reverse}"></span>
</h3>
</td>
I wish to add the text CategoryParent with the number from parentCategory.Count to create a dynamic link.
When inspecting the link in the browser I get the corret outcome which is CategoryParent0, CategoryParent1, CategoryParent2 and so on. But when clicking the link I get the following error:
Error: [$parse:syntax] http://errors.angularjs.org/1.2.16/$parse/syntax?p0=%7B&p1=is%20an%20unexpe…Parent%7B%7BparentCategory.Count%7D%7D&p4=%7B%7BparentCategory.Count%7D%7D
at Error (native)
at http://localhost:51976/Scripts/angular.min.js:6:450
at $a.throwError (http://localhost:51976/Scripts/angular.min.js:165:141)
at $a.parse (http://localhost:51976/Scripts/angular.min.js:164:6)
at $get (http://localhost:51976/Scripts/angular.min.js:96:122)
at http://localhost:51976/Scripts/angular.min.js:129:290
at http://localhost:51976/Scripts/angular.min.js:10:248
at Array.forEach (native)
at q (http://localhost:51976/Scripts/angular.min.js:7:280)
at Uc (http://localhost:51976/Scripts/angular.min.js:10:219)
On the angular page its says the following:
Syntax Error: Token '{' is an unexpected token at column 15 of the expression [CategoryParent{{parentCategory.Count}}] starting at [{{parentCategory.Count}}].
I have been looking at this answer AngularJS expression throwing a Syntax error in ng-click and therefore tried many different compinations in the order() method but I cant figure out how to make the link dynamic without using brackets.
Right now the parentCategory.Count is an int but I have also tried to parse it to a string but without any success.
ng-click already takes an Angular expression - so no need for the {{}}
ng-click="order('CategoryParent' + parentCategory.Count)"

Parse error while rendering the pdf file in angularjs app

When I try to access the pdf file which is public using the angular-pdf-viewer I got the following error message on console.
Error: [$parse:syntax] Syntax Error: Token ':' is an unexpected token at column 5 of the expression [http://pucdocket.s3.amazonaws.com/VA/PUE-2010-00039/122913.pdf] starting at [://pucdocket.s3.amazonaws.com/VA/PUE-2010-00039/122913.pdf].
here is my pdf directive for rendering the pdf file:
<pdf-viewer delegate-handle="my-pdf-container" url="http://pucdocket.s3.amazonaws.com/VA/PUE-2010-00039/122913.pdf" scale="1" show-toolbar="true" ></pdf-viewer>
could anyone help on this issue?
all the samples seems to be suggesting define url on scope and reference it. But you may try the following, which stringifys the url
<pdf-viewer delegate-handle="my-pdf-container" url="'http://pucdocket.s3.amazonaws.com/VA/PUE-2010-00039/122913.pdf'" scale="1" show-toolbar="true" ></pdf-viewer>

Resources