AngularJS caseInsensitiveMatch not working - angularjs

I referred to AngularJS + Base Href Case Sensitive? this thread. As per that I should be using 1.1.5 however still I am having the problem.
Angular is still returning the same error.Here is what i am doing.
$routeProvider.otherwise({ redirectTo: '/' , caseInsensitiveMatch : true });
My base Href is /appname/. Now anyone can enter URL like AppName or appName or any combination.
Right now routing works only when URL contains what is given in base href.
Anything I am doing wrong ?
Here is output in console
Uncaught TypeError: Cannot read property '1' of null angular.js:5637
matchUrl angular.js:5637
$$parse angular.js:5704
$get angular.js:6120
invoke angular.js:2931
(anonymous function) angular.js:2771
getService angular.js:2891
invoke angular.js:2909
(anonymous function) angular.js:2771
getService angular.js:2891
invoke angular.js:2909
(anonymous function) angular.js:2775
forEach angular.js:148
createInjector angular.js:2775
resumeBootstrapInternal angular.js:1001
bootstrap angular.js:1017
angularInit angular.js:977
(anonymous function) angular.js:16872
jQuery.Callbacks.fire jquery-1.8.2.js:974
jQuery.Callbacks.self.fireWith jquery-1.8.2.js:1082
jQuery.extend.ready jquery-1.8.2.js:406
DOMContentLoaded jquery-1.8.2.js:83

caseInsensitiveMatch is not in the documentation for Angular 1.1.5. It seems best to upgrade and see if that solves the issue.

Related

Angular Digest issue with Directive. after is undefined $AnimateProvider</this.$get</<.enter

I am having issue with angular digest cycle.Could not find out what cause this.
Chrome Log
```angular.js:12783 TypeError: Cannot read property 'parent' of undefined
at Object.enter (angular.js:5280)
at ngRepeatTransclude (angular.js:28086)
at publicLinkFn (angular.js:7844)
at boundTranscludeFn (angular.js:7983)
at controllersBoundTransclude (angular.js:8593)
at ngRepeatAction (angular.js:28080)
at $watchCollectionAction (angular.js:16068)
at Scope.$digest (angular.js:16203)
at Scope.$apply (angular.js:16467)
at buildPageNumberList (ngPDFjs.js:92)```
Earlier it was working fine. Mean time i did merge my new big changes which broke it. some how $$childTail of $parent get changed to ChildScope to Scope. Which i think cause this issue.I am not sure though.
Fire Fox log:-
Error: after is undefined
$AnimateProvider</this.$get</<.enter#http://localhost:3333/vendor.js:14491:9
ngRepeatTransclude#http://localhost:3333/vendor.js:37297:17
publicLinkFn#http://localhost:3333/vendor.js:17055:29
createBoundTranscludeFn/boundTranscludeFn#http://localhost:3333/vendor.js:17194:16
controllersBoundTransclude#http://localhost:3333/vendor.js:17804:18
ngRepeatAction#http://localhost:3333/vendor.js:37291:15
$watchCollectionAction#http://localhost:3333/vendor.js:25279:13
$RootScopeProvider/this.$get</Scope.prototype.$digest#http://localhost:3333/vendor.js:25414:23
$RootScopeProvider/this.$get</Scope.prototype.$apply#http://localhost:3333/vendor.js:25678:13
buildPageNumberList#http://localhost:3333/app.js:5386:13
promise callback*PDFDocumentLoadingTask_then#http://localhost:3333/vendor.js:98684:14
loadPDF#http://localhost:3333/app.js:5374:13
handleSrcChanged#http://localhost:3333/app.js:5340:21
$CompileProvider/this.$get</Attributes.prototype.$set/<#http://localhost:3333/vendor.js:16881:13
forEach#http://localhost:3333/vendor.js:9552:11
$CompileProvider/this.$get</Attributes.prototype.$set#http://localhost:3333/vendor.js:16879:24
interpolateFnWatchAction#http://localhost:3333/vendor.js:18187:23
interpolateFnWatcher#http://localhost:3333/vendor.js:20599:17
watchGroupAction#http://localhost:3333/vendor.js:25084:13
$RootScopeProvider/this.$get</Scope.prototype.$digest#http://localhost:3333/vendor.js:25414:23
$RootScopeProvider/this.$get</Scope.prototype.$apply#http://localhost:3333/vendor.js:25678:13
EventHandlerNonNull*createHttpBackend/<#http://localhost:3333/vendor.js:20185:7
sendReq#http://localhost:3333/vendor.js:20032:9
$http/serverRequest#http://localhost:3333/vendor.js:19742:16
processQueue#http://localhost:3333/vendor.js:24308:28
scheduleProcessQueue/<#http://localhost:3333/vendor.js:24324:27
$RootScopeProvider/this.$get</Scope.prototype.$eval#http://localhost:3333/vendor.js:25570:16
$RootScopeProvider/this.$get</Scope.prototype.$digest#http://localhost:3333/vendor.js:25386:15
$RootScopeProvider/this.$get</Scope.prototype.$apply#http://localhost:3333/vendor.js:25678:13
EventHandlerNonNull*createHttpBackend/<#http://localhost:3333/vendor.js:20185:7
sendReq#http://localhost:3333/vendor.js:20032:9
$http/serverRequest#http://localhost:3333/vendor.js:19742:16
processQueue#http://localhost:3333/vendor.js:24308:28
scheduleProcessQueue/<#http://localhost:3333/vendor.js:24324:27
$RootScopeProvider/this.$get</Scope.prototype.$eval#http://localhost:3333/vendor.js:25570:16
$RootScopeProvider/this.$get</Scope.prototype.$digest#http://localhost:3333/vendor.js:25386:15
$RootScopeProvider/this.$get</Scope.prototype.$apply#http://localhost:3333/vendor.js:25678:13
bootstrapApply#http://localhost:3333/vendor.js:10897:9
invoke#http://localhost:3333/vendor.js:13771:14
bootstrap/doBootstrap#http://localhost:3333/vendor.js:10895:5
bootstrap#http://localhost:3333/vendor.js:10915:12
angularInit#http://localhost:3333/vendor.js:10809:5
#http://localhost:3333/vendor.js:39025:5
jQuery.Callbacks/fire#http://localhost:3333/vendor.js:3099:10
jQuery.Callbacks/self.fireWith#http://localhost:3333/vendor.js:3211:7
.ready#http://localhost:3333/vendor.js:3417:3
completed#http://localhost:3333/vendor.js:3433:2
EventListener.handleEvent*jQuery.ready.promise#http://localhost:3333/vendor.js:3451:4
#http://localhost:3333/vendor.js:3461:1
#http://localhost:3333/vendor.js:34:3
#http://localhost:3333/vendor.js:15:2

Unexpected end of input in ui-bootstrap file

I get this error whenever I load the page I am building. Everything worked fine until I copied the angular-ui-bootstrap js file. I have not changed anything from the file.
angular.module('ui.bootstrap.datepicker').run(function() {
!angular.$$csp().noInlineStyle && angular.element(document).find('head').prepend('<style type="text/css">.uib- datepicker .uib-title{width:100%;}.uib-day button,.uib-month button,.uib-year button{min-width:100%;}.uib-datepicker-popup.dropdown-menu{display:block;}.uib-button-bar{padding:10px 9px 2px;}</style>');});
This is the portion of code where it has a missing } but that is not the case as I can see. I am running AngularJS 1.4.9 and Bootstrap 3.3.2.
Any ideas?
update: When I change to Angular 1.4.0 I get
$q.resolve is not a function error
full error
TypeError: $q.resolve is not a function
at http://localhost:8080/build/js/all-136a0f7ece.js:46792:32
at Object.forEach (http://localhost:8080/build/js/all-136a0f7ece.js:350:20)
at Object.resolve (http://localhost:8080/build/js/all-136a0f7ece.js:46790:19)
at Object.$modal.open (http://localhost:8080/build/js/all-136a0f7ece.js:47357:69)
at Scope.$scope.open (http://localhost:8080/build/js/all-136a0f7ece.js:46443:35)
at fn (eval at <anonymous> (http://localhost:8080/build/js/all-136a0f7ece.js:13036:15), <anonymous>:4:203)
at callback (http://localhost:8080/build/js/all-136a0f7ece.js:23090:17)
at Scope.$eval (http://localhost:8080/build/js/all-136a0f7ece.js:15719:28)
at Scope.$apply (http://localhost:8080/build/js/all-136a0f7ece.js:15818:23)
at HTMLAnchorElement.<anonymous> (http://localhost:8080/build/js/all-136a0f7ece.js:23095:23)

Error after using ngAnimate: TypeError: Cannot read property 'ng-scope' and 'col-sm-6' of undefined

I've added angular animation to my project. I only placed this to my index.html and app.js. Is there something I've missed? Thanks in advance
Index.html
<script src="http://code.angularjs.org/1.2.1/angular-animate.js"></script>
App.js
angular.module('portfolio', ['ui.bootstrap','ui.router', 'ngAnimate', 'service', 'ctrl'])
Console: Error
TypeError: Cannot read property 'ng-scope' of undefined
at lookup (angular-animate.js:294)
at performAnimation (angular-animate.js:563)
at angular-animate.js:358
at m.$digest (angular.js:16215)
at m.$apply (angular.js:16429)
at g (angular.js:10823)
at t (angular.js:11021)
at XMLHttpRequest.w.onload (angular.js:10962)(anonymous function) # angular.js:12793(anonymous function) # angular.js:9526m.$digest # angular.js:16217m.$apply # angular.js:16429g # angular.js:10823t # angular.js:11021w.onload # angular.js:10962
angular.js:12793
TypeError: Cannot read property 'col-sm-6' of undefined
at lookup (angular-animate.js:294)
at performAnimation (angular-animate.js:563)
at angular-animate.js:358
at m.$digest (angular.js:16215)
at m.$apply (angular.js:16429)
at g (angular.js:10823)
at t (angular.js:11021)
at XMLHttpRequest.w.onload (angular.js:10962)
This question seems very similar to this post AngularJS: $$selectors undefined when trying to use ngAnimate
The suggestion seems to point to a mismatch between angular and angular animate module
I had the same error and the solution was the http. So i upgraded the version and i used this link instead. I hope that helps
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.3/angular-animate.js"></script>

how to remove given error " Failed to instantiate module app due to:"

I am trying to make simple app in angular js .I includes js files in my project. But I am getting this error
**Uncaught Error: [$injector:modulerr] Failed to instantiate module app due to:
Error: [$injector:modulerr] Failed to instantiate module app.stationselect due to:
TypeError: $urlRouterProvider.state is not a function
at routeChange (http://localhost:63342/www/js/stationselect/router.js:9:28)
at Object.invoke (http://localhost:63342/www/lib/ionic.bundle.js:12877:17)
at runInvokeQueue (http://localhost:63342/www/lib/ionic.bundle.js:12783:35)
at http://localhost:63342/www/lib/ionic.bundle.js:12792:11
at forEach (http://localhost:63342/www/lib/ionic.bundle.js:9015:20)
at loadModules (http://localhost:63342/www/lib/ionic.bundle.js:12773:5)
at http://localhost:63342/www/lib/ionic.bundle.js:12790:40
at forEach (http://localhost:63342/www/lib/ionic.bundle.js:9015:20)
at loadModules (http://localhost:63342/www/lib/ionic.bundle.js:12773:5)
at createInjector (http://localhost:63342/www/lib/ionic.bundle.js:12699:11)
http://errors.angularjs.org/1.3.13/$injector/modulerr?p0=app.stationselect&…(http%3A%2F%2Flocalhost%3A63342%2Fwww%2Flib%2Fionic.bundle.js%3A12699%3A11)
at REGEX_STRING_REGEXP (http://localhost:63342/www/lib/ionic.bundle.js:8755:12)
at http://localhost:63342/www/lib/ionic.bundle.js:12812:15
at forEach (http://localhost:63342/www/lib/ionic.bundle.js:9015:20)
at loadModules (http://localhost:63342/www/lib/ionic.bundle.js:12773:5)
at http://localhost:63342/www/lib/ionic.bundle.js:12790:40
at forEach (http://localhost:63342/www/lib/ionic.bundle.js:9015:20)
at loadModules (http://localhost:63342/www/lib/ionic.bundle.js:12773:5)
at createInjector (http://localhost:63342/www/lib/ionic.bundle.js:12699:11)
at doBootstrap (http://localhost:63342/www/lib/ionic.bundle.js:10137:20)
at bootstrap (http://localhost:63342/www/lib/ionic.bundle.js:10158:12)
http://errors.angularjs.org/1.3.13/$injector/modulerr?p0=app&p1=Error%3A%20…(http%3A%2F%2Flocalhost%3A63342%2Fwww%2Flib%2Fionic.bundle.js%3A10158%3A12)**
actually I check
when I remove one script from index.html it remove that error
script is this
<script src="js/stationselect/router.js"></script>
But when I include again it show again given error
I don't what thing I write wrong ? Actually in my app there is some directory so I am not able to use fiddle .I will share my code with you
https://dl.dropbox.com/s/l2dtrxmnsurccxt/www.zip?dl=0
here is my script code
(function(){
'use strict'
angular.module('app.stationselect').config(routeChange);
routeChange.$inject=['$stateProvider','$urlRouterProvider'];
function routeChange($stateProvider, $urlRouterProvider){
$urlRouterProvider.state('selectstation',{
url:'/selectstation',
controller:'selectStation',
templateUrl:'js/stationselect/partial/home.html'
})
$urlRouterProvider.otherwise('/selectstation');
}
})();
Looks like you should have
angular.module('app.stationselect', ['ui.router']).config(...)
if you're creating the app.stationselect module there.
When you only provide one argument to angular.module() (ie, the module name), Angular attempts to retrieve it from the module registry.
If you've already created your module elsewhere, ignore the above.
Also, .state is a method of $stateProvider, not $urlRouterProvider. This is what's causing the error message.

xdomain net::ERR_NAME_NOT_RESOLVED

I am writing AngularJS application and using xdomain (https://github.com/jpillora/xdomain) proxy for CORS REST service.
Everything works fine and erros are handled correctly excpet one case - when proxy.html required by xdomain library is not accesible (network or server error)
In that case I get:
GET https://server.test.pl:41012/proxy.html net::ERR_NAME_NOT_RESOLVED
getFrame xdomain.js:520
(anonymous function) xdomain.js:616
facade.send.process xdomain.js:446
facade.send xdomain.js:449
(anonymous function) angular.js:8521
sendReq angular.js:8315
$HttpProvider.$get.serverRequest angular.js:8049
deferred.promise.then.wrappedCallback angular.js:11520
(anonymous function) angular.js:11606
$RootScopeProvider.$get.Scope.$eval angular.js:12632
$RootScopeProvider.$get.Scope.$digest angular.js:12444
$RootScopeProvider.$get.Scope.$apply angular.js:12736
(anonymous function) angular.js:1438
invoke angular.js:3940
doBootstrap angular.js:1436
bootstrap angular.js:1450
(anonymous function) app.js:86
trigger angular.js:2563
(anonymous function) angular.js:2843
forEach angular.js:325
eventHandler angular.js:2842
I want to intercept this error and handle it but problem is I don't know how:
$http catch/error promise method is not called
httInterceptor i wrote is not invoked
How can I hadle this error?

Resources