Priyank Thakkar
Priyank Thakkar

Reputation: 4852

Error in Handlebar.js while using ember

I have downloaded startpack from emberjs.com, it contains 3 js files:

  1. ember-1.0.0-rc.5
  2. handlebars-1.0.0-rc.4
  3. jquery-1.9.1

I created a dynamic web project in eclipse and pasted this js file in WebContents/views/js/lib folder under project.

I am getting an error in handlebars-1.0.0-rc.4.js file at line:

lexer.rules = [/^(?:\\\\(?=(\{\{)))/,/^(?:[^\x00]*?(?=(\{\{)))/,/^(?:[^\x00]+)/,/^(?:[^\x00]{2,}?(?=(\{\{|$)))/,/^(?:[\s\S]*?--\}\})/,/^(?:\{\{>)/,/^(?:\{\{#)/,/^(?:\{\{\/)/,/^(?:\{\{\^)/,/^(?:\{\{\s*else\b)/,/^(?:\{\{\{)/,/^(?:\{\{&)/,/^(?:\{\{!--)/,/^(?:\{\{![\s\S]*?\}\})/,/^(?:\{\{)/,/^(?:=)/,/^(?:\.(?=[}/ ]))/,/^(?:\.\.)/,/^(?:[\/.])/,/^(?:\s+)/,/^(?:\}\}\})/,/^(?:\}\})/,/^(?:"(\\["]|[^"])*")/,/^(?:'(\\[']|[^'])*')/,/^(?:@[a-zA-Z]+)/,/^(?:true(?=[}\s]))/,/^(?:false(?=[}\s]))/,/^(?:-?[0-9]+(?=[}\s]))/,/^(?:[a-zA-Z0-9_$:\-]+(?=[=}\s\/.]))/,/^(?:\[[^\]]*\])/,/^(?:.)/,/^(?:\s+)/,/^(?:[a-zA-Z0-9_$\-\/]+)/,/^(?:$)/];

Syntex error token "," delete this token Syntex error token ")" delete this token Syntex error token "]" delete this token

Kindly help me.

Upvotes: 0

Views: 107

Answers (2)

david
david

Reputation: 100

when you have 3rd party js libraries that gives errors exclude them from the eclipse validation

How to exclude a Javascript file from Javascript Validation in Eclipse

this way you keep all error validation on your code, but can exclude on jquery handlebars etc

and makes you built the app

Upvotes: 1

intuitivepixel
intuitivepixel

Reputation: 23322

I guess your problem is then the order in which you are loading the js files, try to change it to:

  1. jquery-1.9.1
  2. handlebars-1.0.0-rc.4
  3. ember-1.0.0-rc.5
  4. your app.js etc...

Please see here a working example with the order showed above.

Hope it helps

Upvotes: 0

Related Questions