3

First time using ng-view with Angular and on a fresh application of angular js with ng-view I am having all these scrollTo errors. How can I fix this? Ive checked StackOverflow and Google and cannot find a solution. Even the Angular seed app I am having the same issues.

Console errors

TypeError: Property 'scrollTo' of object [object global] is not a function
    at scroll (http://localhost/angular/lib/angular.js:2946:26)
    at Object.Scope.$eval (http://localhost/angular/lib/angular.js:8685:28)
    at Object.Scope.$digest (http://localhost/angular/lib/angular.js:8548:23)
    at Object.Scope.$apply (http://localhost/angular/lib/angular.js:8771:24)
    at http://localhost/angular/lib/angular.js:986:15
    at Object.invoke (http://localhost/angular/lib/angular.js:2873:25)
    at resumeBootstrapInternal (http://localhost/angular/lib/angular.js:984:14)
    at bootstrap (http://localhost/angular/lib/angular.js:998:12)
    at angularInit (http://localhost/angular/lib/angular.js:959:5)
    at http://localhost/angular/lib/angular.js:16310:5 angular.js:6173
TypeError: Property 'scrollTo' of object [object global] is not a function
    at scroll (http://localhost/angular/lib/angular.js:2946:26)
    at <error: illegal access>
    at Object.Scope.$broadcast (http://localhost/angular/lib/angular.js:8935:28)
    at http://localhost/angular/lib/angular.js:7960:26
    at wrappedCallback (http://localhost/angular/lib/angular.js:7303:59)
    at wrappedCallback (http://localhost/angular/lib/angular.js:7303:59)
    at http://localhost/angular/lib/angular.js:7340:26
    at Object.Scope.$eval (http://localhost/angular/lib/angular.js:8685:28)
    at Object.Scope.$digest (http://localhost/angular/lib/angular.js:8548:23)
    at Object.Scope.$apply (http://localhost/angular/lib/angular.js:8771:24) 

Updated with what I have in my files, as you see its just fresh app.

index.html

<!doctype html>
<html lang="en" ng-app="app">
<head>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0">
    <title>Mobile App</title>
    <link href="css/default.css" rel="stylesheet" type="text/css">
    <link href="css/bootstrap-min.css" rel="stylesheet" type="text/css">
</head>
<body>

    <div ng-view></div>

    <!--<script src="lib/angular-min.js"></script>-->
    <script src="lib/angular.js"></script>
    <script src="js/app.js"></script>
    <script src="js/controllers.js"></script>
    <script src="js/directives.js"></script>
    <script src="js/services.js"></script>

</body>
</html>

app.js

var app = angular.module('app', ['Controllers', 'Directives', 'Services']);

controllers.js

angular.module('Controllers', []);

directives.js

angular.module('Directives', []);

services.js

angular.module('Services', []);
2
  • Please provide peace of code that fires this error! Commented Apr 21, 2013 at 19:47
  • Edited the question. There is no specific code, its just a fresh app and bootstrapped. I only have these errors if I use ng-view. Commented Apr 21, 2013 at 20:21

2 Answers 2

5

brief research shows that the problem is, probably, the chrome popup blocker, disabling him may solve the problem. Please try to run your app in any browser but Chrome, and if you see other behaviour, just dissable the pop-up blocker.

Hope that helps.

Cheers

Sign up to request clarification or add additional context in comments.

2 Comments

That did the trick and should be in the docs. What did you search for? Ive spent hours looking.
Google "TypeError: Property 'scrollTo' of object [object global]", 1st one was about Motools, and then googled same with "AngularJS" and this (github.com/angular/angular.js/issues/2272) once again was about popup-blocker. Im glad we solved ur problem, have a nice day
1

FYI, here's the ticket for it in better popup blocker's issue tracker. Untouched by the developer since 2011, so it doesn't seem like it's going to be fixed anytime soon.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.