angular.js: CRUD operations via $http

These are the basic operations you can do with $http: $http.get(): Accepts aURL and optional config object. Performs an HTTP GETrequest. $http.head(): Accepts a URL and optional config object. Performs an HTTP HEADrequest. $http.post(): Accepts a URL, data object, and optional config object. Performs an HTTP POST request. $http.put(): Accepts a URL, data object, and […]

angular.js: directives

Basic structure: myModule.directive(‘directiveName’, function(){ return { restrict: ‘AE’, replace: true, template: ‘<div class=”{{class}}”>some html, this could also be a reference to an external template. In which case, you can use templateUrl</div>’, link: function(scope, elem, attrs){ // elem is the HTML element the directive was applied to, and attrs are the attributes of the same } […]