title: implementation of angularjs with requirejs
body: <p>I am trying to implement angularjs with requirejs </p>
  
  <p>Here is my applicaiton.js file which loads initially</p>
  
  <pre><code>var config = {
      baseUrl: '/assets/',
      paths: {
          jquery: 'jquery',
          twitter: 'twitter',
          angular: 'angular',
          angularjs: 'angularjs',       # This is the directory
          app: 'app'
      },
      shim: {
          'twitter/bootstrap': {
              deps: ['jquery']
          },
          'angular': {
              exports: 'angular'
          },
          'app': {
              deps: ['jquery']
          }
      }
  }
  
  requirejs.config(config);
  
  requirejs(['jquery', 'twitter/bootstrap', 'angularjs/app', 'app/common']);
  </code></pre>
  
  <p><strong>Directory structure</strong></p>
  
  <pre><code>Application.js
  Angularjs/
      -controllers/
      -directives/
      -Services/
      -app.js
  </code></pre>
  
  <p>As startup angularjs/app.js will be initiated and my app.js contains</p>
  
  <pre><code>define('app', ['angular'], function(angular) {
      var app = angular.module('app', []);
      return app;
  })
  
  require(['app'], function(app) {
      app.controller('FirstController', function($scope) {
          $scope.message = 'hello';
      })
  })  
  </code></pre>
  
  <p>While running getting the exception as </p>
  
  <p><strong>Failed to instantiate module app</strong></p>
  
  <p>Used <a href="http://kielczewski.eu/2013/04/integrating-angularjs-with-requirejs/" rel="nofollow">this as reference link</a></p>