angular js calling services twice – Angular JS

Hey everyone,

I had a few of my AngularJS services being called twice. The issue turned out to be that I’d added a controller to both my route and my view:

app.config(function ($routeProvider) {
		.when('/', {
		    controller: 'ProjectsController', /* <---- here */
		    templateUrl: '/Home/Home'
    <ul ng-controller="ProjectsController"><!-- <-- here -->
        <li ng-repeat="project in projects">

Removing it from the controller resolved the issue. Check out the following StackOverflow post for more info:

Leave a Reply