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

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

Related

How to upgrade from angular-strap-0.7.5

I've inherited a project using angular-strap-0.7.5.
I've upgraded Angular from 0.10 to 1.6.4, and resolved most of the problems (very few, btw).
However, bsPopover is crashing and here's the stack trace:
angular.js:14525 Error: [$http:badreq] Http request configuration url must be a string or a $sce trusted object. Received: undefined
http://errors.angularjs.org/1.6.4/$http/badreq?p0=undefined
at http://localhost.auspost.com.au:4445/lib/js/vendor/node_modules/angular/angular.js:66:12
at $http (http://localhost.auspost.com.au:4445/lib/js/vendor/node_modules/angular/angular.js:11967:30)
at Function.$http.(anonymous function) [as get] (http://localhost.auspost.com.au:4445/lib/js/vendor/node_modules/angular/angular.js:12237:18)
at Object.postLink [as link] (http://localhost.auspost.com.au:4445/lib/js/vendor/angular-strap-0.7.5/angular-strap.js:564:71)
at http://localhost.auspost.com.au:4445/lib/js/vendor/node_modules/angular/angular.js:1346:18
at invokeLinkFn (http://localhost.auspost.com.au:4445/lib/js/vendor/node_modules/angular/angular.js:10426:9)
at nodeLinkFn (http://localhost.auspost.com.au:4445/lib/js/vendor/node_modules/angular/angular.js:9815:11)
at compositeLinkFn (http://localhost.auspost.com.au:4445/lib/js/vendor/node_modules/angular/angular.js:9055:13)
at compositeLinkFn (http://localhost.auspost.com.au:4445/lib/js/vendor/node_modules/angular/angular.js:9058:13)
at nodeLinkFn (http://localhost.auspost.com.au:4445/lib/js/vendor/node_modules/angular/angular.js:9809:11) "
<span class="remove ng-scope" generic-modal="/content/projects/modal/project-delete.html" ng-click="deleteProject=listProject" bs-popover="popover.content" data-placement="left" data-content="Delete this project" data-trigger="hover">"
I've tried upgrading to this one: http://mgcrea.github.io/angular-strap/
Now I don't get a stack trace or any errors, but the popover just shows the dark background (mask) and does nothing else.
Anyone got a simple answer?

angular.js:11607 TypeError: fn is not a function

I am facing a problem with this link below which I want to use in my code,Its working fine but I am getting one error whenever I click on add fields button.
http://www.shanidkv.com/blog/angularjs-adding-form-fields-dynamically
The Error is as follows,
angular.js:11607 TypeError: fn is not a function
at $parseFunctionCall (angular.js:12346)
at callback (angular.js:21435)
at Scope.$eval (angular.js:14401)
at Scope.$apply (angular.js:14500)
at HTMLFormElement.<anonymous> (angular.js:21440)
at HTMLFormElement.dispatch (jquery-1.9.1.min.js:3)
at HTMLFormElement.v.handle (jquery-1.9.1.min.js:3)

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)

Jasmine Controller test: $timeout.flush() causes an 'Unexpected GET request' error

I have the following test:
it('should load productGroups into the scope', function(){
scope._section = 'modifiers';
scope.userData = {method: 'manual'};
scope.$digest();
timeout.flush();//causes the error
expect(scope.productGroups).toEqual(productGroupService.getProductGroups());
});
Now, the action that I am trying to test occurs within a timeout of 0, because of some issues I had with syncing the data stored in the cookies.
Now, without the marked line, the test runs find, except the expected result is not obtained.
With the marked line, I get the following error:
Error: Unexpected request: GET views/main.html
No more request expected
at $httpBackend (/home/oleg/dev/vita-webapp-new/bower_components/angular-mocks/angular-mocks.js:1178:9)
at sendReq (/home/oleg/dev/vita-webapp-new/bower_components/angular/angular.js:8180:9)
at $http.serverRequest (/home/oleg/dev/vita-webapp-new/bower_components/angular/angular.js:7921:16)
at wrappedCallback (/home/oleg/dev/vita-webapp-new/bower_components/angular/angular.js:11319:81)
at wrappedCallback (/home/oleg/dev/vita-webapp-new/bower_components/angular/angular.js:11319:81)
at /home/oleg/dev/vita-webapp-new/bower_components/angular/angular.js:11405:26
at Scope.$eval (/home/oleg/dev/vita-webapp-new/bower_components/angular/angular.js:12412:28)
at Scope.$digest (/home/oleg/dev/vita-webapp-new/bower_components/angular/angular.js:12224:31)
at Scope.$apply (/home/oleg/dev/vita-webapp-new/bower_components/angular/angular.js:12516:24)
at Object.fn (/home/oleg/dev/vita-webapp-new/bower_components/angular/angular.js:14023:36)
Process finished with exit code 0
main.html, is obviously the view of this controller, tried placing it in templateCache with the following code, but it did not help:
$templateCache.put('views/main.html', $templateCache.get('app/views/views/main.html'));
Any assistance would be much appreciated.
Solution I've been able to come up with is:
$httpBackend.when('GET', 'views/main.html').respond('');
in the beforeEach function
Nothing else doesn't seem to work.
While it's a working solution for unit-testing purposes, it would never work for an E2E test.

AngularJS caseInsensitiveMatch not working

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.

Resources