title: Integrating Spring MVC with Angular
body: <p>I made a very simple application with Spring and Hibernate. It is a Employee repository. Now, I try to make frontend for that. I don't know anything about frameworks but I'm try to find the easier way to show my backend. So, I found that tutorial: <a href="https://spring.io/guides/gs/consuming-rest-angularjs/" rel="nofollow">https://spring.io/guides/gs/consuming-rest-angularjs/</a> . Next, I made that 2 files with my data: </p>
  
  <pre><code>&lt;!doctype html&gt;
  &lt;html ng-app="demo"&gt;
      &lt;head&gt;
          &lt;title&gt;Hello AngularJS&lt;/title&gt;
          &lt;script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.3/angular.min.js"&gt;&lt;/script&gt;
          &lt;script src="hello.js"&gt;&lt;/script&gt;
      &lt;/head&gt;
  
      &lt;body&gt;
          &lt;div ng-controller="Hello"&gt;
              &lt;p&gt;ID is {{employee.id}}&lt;/p&gt;
              &lt;p&gt;The firstName is {{employee.firstName}}&lt;/p&gt;
              &lt;p&gt;The lastName is {{employee.lastName}}&lt;/p&gt;
              &lt;p&gt;The salary is {{employee.salary}}&lt;/p&gt;
          &lt;/div&gt;
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>and hello.js:</p>
  
  <pre><code>&lt;!doctype html&gt;
  &lt;html ng-app="demo"&gt;
      &lt;head&gt;
          &lt;title&gt;Hello AngularJS&lt;/title&gt;
          &lt;script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.3/angular.min.js"&gt;&lt;/script&gt;
          &lt;script src="hello.js"&gt;&lt;/script&gt;
      &lt;/head&gt;
  
      &lt;body&gt;
          &lt;div ng-controller="Hello"&gt;
              &lt;p&gt;ID is {{employee.id}}&lt;/p&gt;
              &lt;p&gt;The firstName is {{employee.firstName}}&lt;/p&gt;
              &lt;p&gt;The lastName is {{employee.lastName}}&lt;/p&gt;
              &lt;p&gt;The salary is {{employee.salary}}&lt;/p&gt;
          &lt;/div&gt;
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>I have method which are returning "Employee" object:</p>
  
  <pre><code>@RequestMapping("/dawaj")
  public Employee getEmploye() {
       return employeeRepository.findByFirstName("Jan");
  }
  </code></pre>
  
  <p>I'm trying to integrate my result from localhost:8080/application/dawaj with index.html... Could you tell me why link: localhost:8080/application/dawaj is returning Json code and localhost:8080 is returning good index with data from getEmploye()? Can I integrate that method with index? I want that localhost:8080/application/dawaj is returning index.html with data from that method...</p>
  
  <p>Project structure:
  public | hello.js index.html <strong>&amp;&amp;</strong>
  src    | main ...</p>