// $http и $resource возвращают Promise
$http.get('/my/cool/url')
.then(function(data) {
    // здесь обрабатываем корректный результат запроса
},
function(error) {
    // здесь некорректный
});resolve: {
    data: ['loader', function(loader) {
        // метод, выполняющий запрос к серверу
        return loader.load();
    }],
}...
$routeProvider.when('/', {
      templateUrl: 'views/home.html',
      controller: 'HomePageCtrl',
         resolve: 
         	{
         		loadedContent: ['$http', function($http) {
         			return $http.get('/data');
         		}],
         	}
...angular.module('someApp').controller('HomePageCtrl', ['$scope', 'loadedContent', function($scope, loadedContent){
	$scope.data = loadedContent;
}]);      $http(response.config).then(function(data) {
    deffered.resolve(data);
 }, deferred.reject);Что лучше индексируется поисковиками angular-route.js или ui-router?
Как дела обстоят с # в ui-router и ее фиксингом?
есть ли аналог $stateParams в angular-route.js?
Вопрос такой, чем вообще лучше пользоваться?
$http.get('/somepath')
.then(function(data) {
    // обрабатываем полученный ответ от сервера
   // объект data можно присвоить чему угодно, тут отличий никаких нет
    console.log(data);
    },
function(error) {
    // сюда мы попадаем, если при обрабоке запроса произошла ошибка
    console.log(error);
});      function stop(track) {
    track.pause();
    track.currentTime = 0;
}      <div ng-click='scrollTo("info")'>go to info</div>// some controller
['$scope', $anchorScroll, function($scope, $anchorScroll) {
    $scope.scrollTo = function(id) {
        $location.hash(id);
        $anchorScroll();
    }
}];$rootScope.$on('$routeChangeSuccess', function(newRoute, oldRoute) {
    if($location.hash()) $anchorScroll();  
});      menu.get(0) либо через квадратные скобки: menu[0]      $match = [
'match_format' => $element->find('div.matchTimeCell')[0]->text()
];      // Появление главного меню
    $('#open-nav').on('click touchstart', function(){
    	$('aside#menu').addClass('active');
    	$(this).addClass('disable');
    });
    // Закрытие главного меню
    $('#close-nav').on('click touchstart', function(){
    	$('aside#menu').removeClass('active');
    	$('#open-nav').removeClass('disable');
    });