title: MEAN io module not working properly
body: <p>I am new in mean stack and i am creating module.</p>
  
  <p>My module is not working properly,some time it works and some time not.
  I dont understand what i am doing wrong.</p>
  
  <blockquote>
    <p>packages/custom/settings/public/routes/settings.js</p>
  </blockquote>
  
  <pre><code>'use strict';
  
  //Setting up route
  angular.module('mean.settings').config(['$stateProvider',
    function($stateProvider) {
  
      // states for my app
      $stateProvider
        .state('all settings', {
          url: '/settings',
          templateUrl: '/settings/views/list.html',        
        });
    }
  ]);
  </code></pre>
  
  <blockquote>
    <p>packages/custom/settings/public/controllers/settings.js</p>
  </blockquote>
  
  <pre><code>'use strict';
  
  angular.module('mean.settings').controller('SettingsController', ['$scope', '$stateParams', '$location', 'Global', 'Settings',
    function($scope, $stateParams, $location, Global, Settings) {
      $scope.global = Global;       
  
      $scope.find = function() {
        Settings.query(function(settings) {
          $scope.settings = settings;
        });
      };
  
    }
  ]);
  </code></pre>
  
  <blockquote>
    <p>packages/custom/settings/public/views/list.html</p>
  </blockquote>
  
  <pre><code>&lt;section data-ng-controller="SettingsController" data-ng-init="find()"&gt;
    &lt;ul class="settings unstyled"&gt;
      &lt;li data-ng-repeat="setting in settings"&gt;
        Hello
        &lt;div&gt;{{setting.Name}}&lt;/div&gt;
      &lt;/li&gt;
    &lt;/ul&gt;
    &lt;h1 data-ng-hide="!settings || settings.length"&gt;No settings yet. &lt;br&gt; Why don't you &lt;a href="/settings/create"&gt;Create One&lt;/a&gt;?&lt;/h1&gt;
  &lt;/section&gt;
  </code></pre>