title: .config $routeprovider angularjs
body: <p>i am using angularjs ..</p>
  
  <p>mainhtml.html</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html data-ng-app="demoapp"&gt;
  &lt;head&gt;
      &lt;script src="scripts/angular.min.js"&gt;&lt;/script&gt;
      &lt;title&gt;Angular js&lt;/title&gt;
  &lt;/head&gt;
   &lt;body&gt; &lt;div data-ng-controller="SimpleController"&gt;
       &lt;div data-ng-view=""&gt;&lt;/div&gt;
  
  &lt;div class="ng-view"&gt;&lt;/div&gt;
      Name:&lt;input type="text" data-ng-model="name" /&gt;{{name}}
      &lt;br /&gt;
      &lt;ul&gt;
          &lt;li data-ng-repeat="cust in customers|filter:name|orderBy:'city'"&gt;{{cust.name|uppercase}}-{{cust.city|lowercase}}&lt;/li&gt;
      &lt;/ul&gt;
          &lt;script&gt;
              var demoapp = angular.module('demoapp', []);
              demoapp.config(['$routeProvider',
            function ($routeProvider) {
           $routeProvider.
            when('/', {
              templateUrl: 'view1.html',
              controller: 'SimpleController'
          }).
          when('/partial2', {
              templateUrl: 'view2.html',
              controller: 'SimpleController'
          }).
          otherwise({
              redirectTo: '/'
          });
    }]);
  demoapp.controller('SimpleController', function ($scope) {
                  $scope.customers = [{ name: 'aman', city: 'boom' },
                                       { name: 'ajay', city: 'reem dee' },
                                       { name: 'hood', city: 'meen' }
                  ];
              });
  
          &lt;/script&gt;
      &lt;/div&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>view1</p>
  
  <pre><code>&lt;div class="container"&gt;
      &lt;h2&gt;View1&lt;/h2&gt;
  Name:
      &lt;input type="text" data-ng-model="filter.name" /&gt;
      &lt;br /&gt;
  
     &lt;ul&gt;
         &lt;li data-ng-repeat="cust in customers|filter :filter.name|orderby"&gt;&lt;/li&gt;
  &lt;/ul&gt;
      &lt;br /&gt;
      Customer name:
      &lt;input type="text" data-ng-model="newCustomer.name"/&gt;
      &lt;br /&gt;
      &lt;br /&gt;
      Customer city:
      &lt;input type="text" data-ng-model="newCustomer.city"/&gt;
      &lt;br /&gt;
      &lt;br /&gt;
      &lt;button data-ng-click="addCustomer()"&gt;Add customer&lt;/button&gt;
      &lt;br /&gt;
      &lt;a href="#/view2"&gt;View2&lt;/a&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>it works well before adding config($routeprovider) function,,,, routeprovider function is destroying the program... anyhelp to work it correctly</p>