How/when to use ng-click to call a route?

Suppose you are using routes: // bootstrap myApp.config([‘$routeProvider’, ‘$locationProvider’, function ($routeProvider, $locationProvider) { $routeProvider.when(‘/home’, { templateUrl: ‘partials/home.html’, controller: ‘HomeCtrl’ }); $routeProvider.when(‘/about’, { templateUrl: ‘partials/about.html’, controller: ‘AboutCtrl’ }); … And in your html, you want to navigate to the about page when a button is clicked. One way would be <a href=”#/about”> … but it seems … Read more

Changing route doesn’t scroll to top in the new page

I’ve found some undesired, at least for me, behaviour when the route changes. In the step 11 of the tutorial http://angular.github.io/angular-phonecat/step-11/app/#/phones you can see the list of phones. If you scroll to the bottom and click on one of the latest, you can see that the scroll isn’t at top, instead is kind of in … Read more

Delaying AngularJS route change until model loaded to prevent flicker

I am wondering if there is a way (similar to Gmail) for AngularJS to delay showing a new route until after each model and its data has been fetched using its respective services. For example, if there were a ProjectsController that listed all Projects and project_index.html which was the template that showed these Projects, Project.query() … Read more

What is the difference between angular-route and angular-ui-router?

I’m planning to use AngularJS in my big applications. So I’m in the process to find out the right modules to use. What is the difference between ngRoute (angular-route.js) and ui-router (angular-ui-router.js) modules? In many articles when ngRoute is used, route is configured with $routeProvider. However, when used with ui-router, route is configured with $stateProvider … Read more