Difference between creating and calling an AngularJs module:

  • angular.module('sambiApp',[])
    creates a new module sambiApp with dependencies.
  • angular.module('sambiApp')
    calls an existing AngularJs module sambiApp.


Place ng-app to the root of your application, typically on the <html> tag if you want angular to auto-bootstrap your application.

Cross-origin Resource Sharing (CORS) Access Control:

CORS is a mechanism that allows many resources (e.g., fonts, JavaScript, etc.) on a web page to be requested from another domain outside the domain from which the resource originated. In particular, JavaScript’s AJAX calls can use the XMLHttpRequest mechanism. Such “cross-domain” requests would otherwise be forbidden by web browsers, per the same-origin security policy. CORS defines a way in which the browser and the server can interact to determine whether or not to allow the cross-origin request. It is more useful than only allowing same-origin requests, but it is more secure than simply allowing all such cross-origin requests.

Cross-site HTTP requests are HTTP requests for resources from a different domain than the domain of the resource making the request. For instance, a resource loaded from Domain 1 (http://sam-bi.com) such as an HTML web page, makes a request for a resource on Domain 2 (http://getbootstrap.com), such as an image, using the img element (http://getbootstrap.com/image.jpg). This occurs very commonly on the web today, pages load a number of resources in a cross-site manner, including CSS stylesheets, images and scripts, and other resources.

The Cross-Origin Resource Sharing standard works by adding new HTTP headers that allow servers to describe the set of origins that are permitted to read that information using a web browser. Additionally, for HTTP request methods that can cause side-effects on user data (in particular, for HTTP methods other than GET, or for POST usage with certain MIME types), the specification mandates that browsers "preflight" the request, soliciting supported methods from the server with an HTTP OPTIONS request method, and then, upon "approval" from the server, sending the actual request with the actual HTTP request method. Servers can also notify clients whether "credentials" (including Cookies and HTTP Authentication data) should be sent with requests.

Angular Seed

The angular-seed project is typically used to bootstrap new Angular projects. The seed project is pre-configured to install the angular framework (via bower into the app/bower_components/ folder) and tools for developing a typical web app (via npm).

Missing request parameters with Firefox:

See Ben Nadel Blog

Running "bower install" you get "ECONNRESET"

Running "bower install" you get "ECONNRESET" error or something like this, if your ".bowerrc" file looks like this (it contains proxy configuration):

  			"directory": "bower_components",
  			"registry": "http://bower.herokuapp.com",
  			"proxy":"http://user:Diese E-Mail-Adresse ist vor Spambots geschützt! Zur Anzeige muss JavaScript eingeschaltet sein!:8080",
  			"https-proxy":"http://user:Diese E-Mail-Adresse ist vor Spambots geschützt! Zur Anzeige muss JavaScript eingeschaltet sein!:8080",
  			"strict-ssl": false

try to change it like the following:

  "directory": "bower_components",
  "interactive": false

Angular config() method:

Using the sambiApp.config() method, we request the $routeProvider to be injected into our config function and use the $routeProvider.when() method to define our routes:

var sambiApp = angular.module('sambiApp', []);
sambiApp.config(['$routeProvider', function($routeProvider) {
			$routeProvider.when('/users', {
				templateUrl: 'partials/user-list.html',
				controller: 'UserListCtrl'

Load an Angular Module

		<html ng-app="sambiApp">
		<body ng-controller="UserListCtrl">		

We have specified an Angular Module to load using ng-app="sambiApp", where sambiApp is the name of our module. This module will contain the UserListCtrl.

Angular Tips und Tricks - SAM Business Informatics