AngularJS tips tricks for beginner

// find('#id')
angular.element(document.querySelector('#id'))

//find('.classname'), assumes you already have the starting elem to search from
angular.element(elem.querySelector('.classname'))
Select element by ID or Class

source : http://stackoverflow.com/a/17329630

//in service

itemsService.loadItems = function (setID) {
    $http({
        url: 'get-items/'+setID,
        method: "POST"
    })
    .success(function (data, status, headers, config) {
        $scope.items = data;
        $rootScope.$broadcast('updateItems', data);
    })
    .error(function (data, status, headers, config) {
        $scope.status = status;
    });
}; 

//in controller

$scope.$on("updateItems",function(d){
  $scope.items = d;
});

//
Automatically reload scope based on user action using Event

source : http://stackoverflow.com/a/17816525

var items = angular.module('items', []);
var text = angular.module('text', []);
var app = angular.module('app', ['items', 'text']);


text.controller('TextController', function ($scope) {
    //Controller Code Here
});

items.controller('ItemController', function ($scope) {
    //Controller Code Here
});
How to use multiple controller in seperate module

source : http://stackoverflow.com/a/20561670