angular.js:12477 SyntaxError: Unexpected token > - angularjs

Did search but cannot find solution yet.
Environment:
angular 1.4.7
chrome 43.0.2357.124
ubuntu pc
Problem:
myBoardStatus.html uses socket.io to talk with node.js server.
When node.js server sees '/myBoardStatus', it sendfile(path.resolve('../client/myBoardStatus.html').
myBoardStatus.html has this line
<script src='/socket.io/socket.io.js'></script>
Right now these 2 URL works fine, in chrome browser i can see messages from server once a while.
http://10.55.200.47:80/myBoardStatus
http://10.55.200.47:80/myBoardStatus.html
But:
In my index.html, i have <div ng-view></div>.
It works fine for other pages through $routeProdiver, when i click buttons, the contents of this div gets updated.
So i added another button "myBoardStatus" trying to display messages from socket.io to this div.
http://10.55.200.47:80/#/5myBoardStatus
$routeProvider.when('/5myBoardStatus', {
templateUrl: 'myBoardStatus.html'
//redirectTo: '/myBoardStatus.html'
});
Got this:
Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience. For more help, check http://xhr.spec.whatwg.org/.
angular.js:12477 SyntaxError: Unexpected token >
at eval (native)
at http://10.55.200.47:80/3rdparty/jquery/jquery.min.js:2:2620
at Function.m.extend.globalEval (http://10.55.200.47:80/3rdparty/jquery/jquery.min.js:2:2631)
at m.fn.extend.domManip (http://10.55.200.47:80/3rdparty/jquery/jquery.min.js:3:23046)
at m.fn.extend.append (http://10.55.200.47:80/3rdparty/jquery/jquery.min.js:3:20507)
at null.<anonymous> (http://10.55.200.47:80/3rdparty/jquery/jquery.min.js:3:22055)
at m.access (http://10.55.200.47:80/3rdparty/jquery/jquery.min.js:3:3286)
at m.fn.extend.html (http://10.55.200.47:80/3rdparty/jquery/jquery.min.js:3:21623)
at link (http://10.55.200.47:80/3rdparty/angular-1.4.7/angular-route.min.js:7:200)
at aa (http://10.55.200.47:80/3rdparty/angular-1.4.7/angular.min.js:73:90) <div ng-view="" class="ng-scope">(anonymous function) # angular.js:12477$get # angular.js:9246aa # angular.js:8791K # angular.js:8289g # angular.js:7680(anonymous function) # angular.js:7555$get.g # angular.js:7699r # angular.js:8316x # angular-route.js:935$get.n.$broadcast # angular.js:16311(anonymous function) # angular-route.js:619(anonymous function) # angular.js:14745$get.n.$eval # angular.js:15989$get.n.$digest # angular.js:15800$get.n.$apply # angular.js:16097h # angular.js:10546K # angular.js:10744z.onload # angular.js:10685
(The 1st line "Synchronous XMLHttpRequest on the main thread is deprecated" is warning)
If i use redirectTo instead of templateUrl, then nothing happens in the browser.
thanks for your help !

Related

Server 500 while accessing 2SexyContent-ContentGroup

I am trying to delete a view by following instructions here: Not able to delete 2sxc view and here: http://2sxc.org/en/blog/post/advanced-dynamic-data-content-understanding-content-type-scopes
I can get to the 2SexyContent-System scope without difficulty but when I try the 2SexyContent-ContentGroup I get a Server 500. 2SexyContent-Template and the other types work just fine. Error is below.
Note I realize the ContentGroup may not even be helpful to me. I do understand Template is where I could ForceDelete but I would like to avoid that. I was hoping ContentGroup might help me locate the parent entities that I need to remove. We have a large site and use 2sxc a lot so I am trying to discover the best way to find these parents and delete them in a healthy way.
Message: Had an error talking to the server (status 500).
Detail: The 'ObjectContent`1' type failed to serialize the response body for content 'application/json;charset=utf-8'.
Get [server name removed]/en-us/desktopmodules/2sxc/api/eav/entities/GetAllOfTypeForAdmin?appId=2&contentType=2SexyContent-ContentGroup 500 (Internal Server Error)
(anonymous) # VM10361:2
(anonymous) # set.min.js?sxcver=8.9.1.13916:103
n # set.min.js?sxcver=8.9.1.13916:99
(anonymous) # set.min.js?sxcver=8.9.1.13916:96
(anonymous) # set.min.js?sxcver=8.9.1.13916:131
$eval # set.min.js?sxcver=8.9.1.13916:145
$digest # set.min.js?sxcver=8.9.1.13916:142
$apply # set.min.js?sxcver=8.9.1.13916:146
(anonymous) # set.min.js?sxcver=8.9.1.13916:276
Sf # set.min.js?sxcver=8.9.1.13916:37
d # set.min.js?sxcver=8.9.1.13916:37
The Content-Group is almost certainly the wrong way to do this, because the ContentGroup is the subset of items assigned to the current module/instance.
If you're trying to support force-delete, best check out how the admin-UI does it.

AngularJS Error using manifest.appcache

Case 1: After event 'cached' comming from window.applicationCache.addEventListener, i get my mobile using OFFLINE MODE(airplane mode i mean),then i open my webapp from HomeScreen icon and everything works fine, except AngularJS, that doesnt get loaded. None function or variable is recnognized.
Case 2: After event 'cached' comming from window.applicationCache.addEventListener, i open my webapp from HomeScreen icon using ONLINE MODE, at this moment angular worked fine because its on correct view. BUT if i dont interact with webApp (Login for example), when i get offline mode, AngularJs get a error and not even the correct view is displayed anymore.
EDIT: I realized that if after cached event, i close web app, and then open it again, without interact, it will work fine in offline mode... How is it possible?
All the calls to Angular scripts are getting called from same page that im using <html manifest="manifest.appcache" type="text/cache-manifest">, why it wont work just after i send it to home screen?
I already tried couple workarounds.. none work!
Any help is appreciated
Above my manifest code:
CACHE MANIFEST
# Learn more:
# https://developer.mozilla.org/en-US/docs/Web/HTML/Using_the_application_cache
# -----------------------------------------------------------------------------
# It's necessary to tell web browsers to reconsider this manifest any time the
# website is updated, and you do so by changing *anything* inside the manifest.
# A common way to do this is by simply updating a commented-out string, like a
# date or a version number, or both:
# 2016-09-10:v1.122
# -----------------------------------------------------------------------------
# This is where you define all of the resources to be cached. Add new and/or
# remove old resourses as needed, keeping each one on its own line. Learn more:
# https://developer.mozilla.org/en-US/docs/Web/HTML/Using_the_application_cache#Explicit_entries
CACHE:
assets\js\jquery.min.js
assets\js\main.js
assets\js\skel.min.js
assets\js\util.js
assets\js\ie\html5shiv.js
assets\js\ie\respond.min.js
js\angular.min.js
js\angular-cookies.min.js
js\app\gmApp-controller.js
js\app\gmApp-factory.js
LICENSE.txt
assets\css\ie8.css
assets\css\ie9.css
assets\css\main.css
assets\fonts\FontAwesome.otf
assets\fonts\fontawesome-webfont.eot
assets\fonts\fontawesome-webfont.svg
assets\fonts\fontawesome-webfont.ttf
assets\fonts\fontawesome-webfont.woff
assets\fonts\fontawesome-webfont.woff2
assets\css\font-awesome.min.css
images\02.png
images\avatar.jpg
images\bg_login.jpg
images\favicon.png
images\fundo-bar.jpg
images\fundo-home.jpg
images\hotel-1.png
images\logo.jpg
images\pic01.jpg
images\pic02.jpg
images\pic03.jpg
images\pic04.jpg
images\pic05.jpg
images\pic06.jpg
images\pic07.jpg
images\pic08.jpg
images\pic09.jpg
images\pic10.jpg
images\pic11.jpg
images\pic12.jpg
images\cancun\chichen-tza.jpg
images\cancun\cirque-soleil.jpg
images\cancun\coco-bongo.jpg
images\cancun\haceienta-mortero.jpg
images\cancun\isla-mujeres.jpg
images\cancun\la-isla-shopping.jpg
images\cancun\navio-pirata.jpg
images\cancun\shopong-plaza.jpg
images\cancun\tulum.jpg
images\cancun\xcaret.jpg
images\cancun\xel-ha.jpg
images\dicas\dica1.jpg
images\dicas\dica2.png
images\dicas\dica3.jpg
images\dicas\dica3a.jpg
images\dicas\dica3b.jpg
images\dicas\dica3c.jpg
images\dicas\dica3d.jpg
images\dicas\dica3e.jpg
images\dicas\dica4.jpg
images\dicas\dica5.jpg
images\dicas\dica6.jpg
images\dicas\dica6a.jpg
images\dicas\dica6b.jpg
images\dicas\dica6c.jpg
images\dicas\dica7.jpg
images\dicas\dica7a.jpg
images\dicas\dica7b.jpg
images\dicas\dica7c.jpg
images\dicas\dica9.jpg
images\dicas\rodape.jpg
images\mini-menu\Cancun-42.jpg
images\mini-menu\chichen-tza.jpg
images\mini-menu\cirque-soleil.jpg
images\mini-menu\coco-bongo.jpg
images\mini-menu\haceienta-mortero.jpg
images\mini-menu\isla-mujeres.jpg
images\mini-menu\la-isla-shopping.jpg
images\mini-menu\navio-pirata.jpg
images\mini-menu\shopong-plaza.jpg
images\mini-menu\tulum.jpg
images\mini-menu\xcaret.jpg
images\mini-menu\xel-ha.jpg
index.html
# -----------------------------------------------------------------------------
# Resources that must be retrieved from the network. The wild card ensures any
# resource not listed in the cache above will instead be downloaded from the
# network. Learn more:
# https://developer.mozilla.org/en-US/docs/Web/HTML/Using_the_application_cache#Network_entries
NETWORK:
*
# -----------------------------------------------------------------------------
# Fallbacks. In each row, if the first resource isn't available, the second
# resource is requested. Uncomment and update as needed. Learn more:
# https://developer.mozilla.org/en-US/docs/Web/HTML/Using_the_application_cache#Fallback_entries
FALLBACK:
assets\fonts\FontAwesome.otf assets\fonts\FontAwesome.otf
assets\fonts\fontawesome-webfont.eot assets\fonts\fontawesome-webfont.eot
assets\fonts\fontawesome-webfont.svg assets\fonts\fontawesome-webfont.svg
assets\fonts\fontawesome-webfont.ttf assets\fonts\fontawesome-webfont.ttf
assets\fonts\fontawesome-webfont.woff assets\fonts\fontawesome-webfont.woff
assets\fonts\fontawesome-webfont.woff2 assets\fonts\fontawesome-webfont.woff2
js\angular.min.js js\angular.min.js
js\angular-cookies.min.js js\angular-cookies.min.js
Detail: all these fallback links are already 'work-arounds' im trying to get everything works fine at 'Add to home screen' event
After a while i realized that it was a css reference inside .css files. After add that references into manifest everything works like a charm

Firebase signInWithEmailAndPassword() 400() POST Error

I’m currently implementing the new firebase auth() in my angularjs app and every time I call
firebase.auth().signInWithEmailAndPassword(email, password)
it does return my promise and error / user object, but at the same time throws the following error in the console:
POST https://www.googleapis.com/identitytoolkit/v3/relyingparty/verifyPassword?key=[myKey] 400 () firebase.min.js:110
Seems to be working as expected but I don't like errors in my console :3
EDIT: Full console error (minified unfortunately):
firebase.min.js:110 POST
https://www.googleapis.com/identitytoolkit/v3/relyingparty/verifyPassword?key=[myKey] 400 ()
L.send # firebase.min.js:110
S.xe # firebase.min.js:151
Vf # firebase.min.js:149
(anonymous function) # firebase.min.js:154
H # firebase.min.js:77
$f # firebase.min.js:154
(anonymous function) # firebase.min.js:162
e.za # firebase.min.js:80
Cd # firebase.min.js:84
yd # firebase.min.js:84
H.Nd # firebase.min.js:83
id # firebase.min.js:77
Guess I'll have to contact firebase support, right?
I can confirm #bojeil's answer, the error is intended behavior. Does not happen when password is correct!

AngularJS Template not properly loading

Had a bit of trouble with Angular earlier, but I was able to resolve that problem. Of course, being a newbie, we've hit more problems!
Did some searching around for this error, but applying the fixes that other people have tried has not proven effective for me.
I am currently trying to load a partial onto a show page in Rails using AngularJS.
EDIT: I apologize- I forgot to mention that I intend to load a partial from a file in the same directory as all these files. Current directory tree is as follows:
Directory containing relevant js files and the timer partial
I have the following code built out:
Show.html.erb
<timer-info ng-controller = "CountdownController">
</timer-info>
app.js
'use strict';
var myApp = angular.module("summoners-universe", ['ngRoute'])
directives.js
'use strict';
myApp.directive("timerInfo", function(){
return {
restrict: "E",
templateUrl: 'app/assets/javascripts/timer.html'
};
});
controllers.js
'use strict';
myApp.controller('CountdownController',
["$scope", "$http", "$routeParams",
function($scope, $http, $routeParams){
console.log($routeParams);
}]);
Eventually this controller will display a countdown timer, but for now, I just wanted to make sure I could get my routeParams and all that.
Sadly, I'm hit with the following error upon page load:
angular.self-208d6d1….js?body=1:11757 GET http://localhost:3000/games/app/assets/javascripts/timer.html 404 (Not Found)(anonymous function) # angular.self-208d6d1….js?body=1:11757sendReq # angular.self-208d6d1….js?body=1:11518serverRequest # angular.self-208d6d1….js?body=1:11228processQueue # angular.self-208d6d1….js?body=1:15962(anonymous function) # angular.self-208d6d1….js?body=1:15978Scope.$eval # angular.self-208d6d1….js?body=1:17230Scope.$digest # angular.self-208d6d1….js?body=1:17046Scope.$apply # angular.self-208d6d1….js?body=1:17338bootstrapApply # angular.self-208d6d1….js?body=1:1750invoke # angular.self-208d6d1….js?body=1:4666doBootstrap # angular.self-208d6d1….js?body=1:1748bootstrap # angular.self-208d6d1….js?body=1:1768angularInit # angular.self-208d6d1….js?body=1:1653(anonymous function) # angular.self-208d6d1….js?body=1:30864fire # jquery.self-4e23968….js?body=1:3188self.fireWith # jquery.self-4e23968….js?body=1:3318jQuery.extend.ready # jquery.self-4e23968….js?body=1:3537completed # jquery.self-4e23968….js?body=1:3553
angular.self-208d6d1….js?body=1:13551 Error: [$compile:tpload] Failed to load template: app/assets/javascripts/timer.html (HTTP status: 404 Not Found)
http://errors.angularjs.org/1.5.5/$compile/tpload?p0=app%2Fassets%2Fjavascripts%2Ftimer.html&p1=404&p2=Not%20Found
at angular.self-208d6d1….js?body=1:69
at handleError (angular.self-208d6d1….js?body=1:18979)
at processQueue (angular.self-208d6d1….js?body=1:15962)
at angular.self-208d6d1….js?body=1:15978
at Scope.$eval (angular.self-208d6d1….js?body=1:17230)
at Scope.$digest (angular.self-208d6d1….js?body=1:17046)
at Scope.$apply (angular.self-208d6d1….js?body=1:17338)
at done (angular.self-208d6d1….js?body=1:11573)
at completeRequest (angular.self-208d6d1….js?body=1:11779)
at XMLHttpRequest.requestLoaded (angular.self-208d6d1….js?body=1:11712)(anonymous function) # angular.self-208d6d1….js?body=1:13551(anonymous function) # angular.self-208d6d1….js?body=1:10226processQueue # angular.self-208d6d1….js?body=1:15970(anonymous function) # angular.self-208d6d1….js?body=1:15978Scope.$eval # angular.self-208d6d1….js?body=1:17230Scope.$digest # angular.self-208d6d1….js?body=1:17046Scope.$apply # angular.self-208d6d1….js?body=1:17338done # angular.self-208d6d1….js?body=1:11573completeRequest # angular.self-208d6d1….js?body=1:11779requestLoaded # angular.self-208d6d1….js?body=1:11712XMLHttpRequest.send (async)(anonymous function) # angular.self-208d6d1….js?body=1:11757sendReq # angular.self-208d6d1….js?body=1:11518serverRequest # angular.self-208d6d1….js?body=1:11228processQueue # angular.self-208d6d1….js?body=1:15962(anonymous function) # angular.self-208d6d1….js?body=1:15978Scope.$eval # angular.self-208d6d1….js?body=1:17230Scope.$digest # angular.self-208d6d1….js?body=1:17046Scope.$apply # angular.self-208d6d1….js?body=1:17338bootstrapApply # angular.self-208d6d1….js?body=1:1750invoke # angular.self-208d6d1….js?body=1:4666doBootstrap # angular.self-208d6d1….js?body=1:1748bootstrap # angular.self-208d6d1….js?body=1:1768angularInit # angular.self-208d6d1….js?body=1:1653(anonymous function) # angular.self-208d6d1….js?body=1:30864fire # jquery.self-4e23968….js?body=1:3188self.fireWith # jquery.self-4e23968….js?body=1:3318jQuery.extend.ready # jquery.self-4e23968….js?body=1:3537completed # jquery.self-4e23968….js?body=1:3553
I don't know why a get request is being made to that URL. Any thoughts? Thank you!
The templateUrl of the timerInfo should be absolute, like this:
templateUrl: '/app/assets/javascripts/timer.html'
This way you're referencing from the root directory down to the desired file.
Ah, I was able to figure it out. Apparently, the Angular-Rails gem looks for templates to load in an app/templates directory. I just had to make that directory and put the template there.

Failed to load template on gulp dist build

We are using a directive that allows users to input their date of birth. This works absolutely fine on the local gulp dev build, however when we move across to a distribution build, it says this template cannot be found. There are no errors in the gulp:dist process or errors in console when using the directive in a local dev build
Here is the error message from the dist build
GET http://localhost:3000/app/_common/form-dob/form-dob.tpl.html 404 (Not Found)(anonymous function) # generated.js:20178l # generated.js:62054v # generated.js:19971c # generated.js:19681u # generated.js:24202(anonymous function) # generated.js:24218h.$eval # generated.js:25462h.$digest # generated.js:25280h.$apply # generated.js:25570o # generated.js:20002g # generated.js:20200w.onload # generated.js:20141
generated.js:21933 Error: [$compile:tpload] Failed to load template: /app/_common/form-dob/form-dob.tpl.html (HTTP status: 404 Not Found)
http://errors.angularjs.org/1.4.9/$compile/tpload?p0=%2Fapp%2F_common%2Fform-dob%2Fform-dob.tpl.html&p1=404&p2=Not%20Found
at generated.js:9279
at s (generated.js:27164)
at u (generated.js:24202)
at generated.js:24218
at h.$eval (generated.js:25462)
at h.$digest (generated.js:25280)
at h.$apply (generated.js:25570)
at o (generated.js:20002)
at g (generated.js:20200)
at XMLHttpRequest.w.onload (generated.js:20141)
Is there a specific reason for this? Can't seem to find any invalid JavaScript in the file.
The directive is very long so haven't included it here. Here is the first part:
(function() {
'use strict';
angular
.module('smApp')
.directive('smFormDob', smFormDob);
smFormDob.$inject = ['angular', 'moment'];
function smFormDob(angular, moment) {
var controller = function($scope, $timeout) {
The issue was the templateUrl had a / at the beginning and that was causing the issue
Here's the broken:
templateUrl: "/app/_common/form-dob/form-dob.tpl.html"
Here's the fixed:
templateUrl: "app/_common/form-dob/form-dob.tpl.html"

Resources