javascript - angularjs routeProvider not working on live server -


I have just uploaded a project from my local host to a live server, but I have a little trouble with some links is! I have this in my route provider:

  $ routeProvider.when ('/ projects /: project', {templateUrl: 'partials / projectPage.html', administrator: 'ProjectPageCtrl'})   

But when I go to the page which is in link text mysite com / project / testing, the hole site crashes and I get this error in the console:

  Syntax error: Unexpected token & lt; Com / js / jquery-1.8.0.min.js on eval (native) on mysite: function at 2: 14066. p.extend.globalEval (mysite com / js / jquery-1.8.0.min.js: 2 : 14077) p.ajaxSetup on .converters.text script (mysite com / js / jquery-1.8.0.min.js: 2: 83767) cc (mysite com / js / jquery-1.8.0.min.js: 2 : 5858) on Y (mysite com / js / jquery-1.8.0.min.js: 2: 79924) at d (mysite com / js / jquery-1.8.0.min.js: 2: 85578) Object.send On (http: // mysite com / js / jquery-1.8.0.min.js: 2: 85705) function at p.extend.ajax (mysite com / js / jquery-1.8.0.min.js: 2 : 82575) On HTMLScriptElement & Lt; Anonymous & gt; (Mysite com / js / jquery-1.8.0.min.js: 2: 68258) & lt; Div ng-view = "" square = "ng-scope" & gt; Angular.js: 9503   

But when I am running it on my local host then everything is working fine. So I have no idea what is wrong: (

Hope someone can help me :)

This looks like a backend error if you are using the REST API, make sure that your JSON is valid. If you try the JSON.parse an HTML page, then the same errors occur:

 Enter image details here

Open the REST API url with your browser and see what is wrong. You can use the Networks tab to preview the response in this way (assuming you're using Chrome, but most modern browsers can do this):

Enter image details here

Comments

Popular posts from this blog

c - Mpirun hangs when mpi send and recieve is put in a loop -

python - Apply coupon to a customer's subscription based on non-stripe related actions on the site -

java - Unable to get JDBC connection in Spring application to MySQL -