This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.sivalabs.app; | |
import java.util.Arrays; | |
import java.util.Date; | |
import javax.annotation.PostConstruct; | |
import org.springframework.beans.factory.annotation.Autowired; | |
import org.springframework.stereotype.Component; | |
import com.sivalabs.app.entities.Todo; | |
import com.sivalabs.app.repos.TodoRepository; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.sivalabs.app.entities; | |
@Entity | |
public class Todo { | |
@Id @GeneratedValue(strategy=GenerationType.AUTO) | |
private Integer id; | |
private String description; | |
@Temporal(TemporalType.TIMESTAMP) | |
private Date createdOn = new Date(); | |
//setters and getters |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.sivalabs.app; | |
import org.springframework.boot.SpringApplication; | |
import org.springframework.boot.autoconfigure.EnableAutoConfiguration; | |
import org.springframework.context.annotation.ComponentScan; | |
import org.springframework.context.annotation.Configuration; | |
import org.springframework.stereotype.Controller; | |
import org.springframework.web.bind.annotation.RequestMapping; | |
@Configuration |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html> | |
<head> | |
<meta charset="utf-8"/> | |
<title>DashBoard</title> | |
<link rel="stylesheet" href="webjars/bootstrap/3.2.0/css/bootstrap.css"/> | |
<link rel="stylesheet" href="webjars/font-awesome/4.1.0/css/font-awesome.css"/> | |
<link rel="stylesheet" href="css/styles.css"/> | |
</head> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<project xmlns="http://maven.apache.org/POM/4.0.0" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 | |
http://maven.apache.org/xsd/maven-4.0.0.xsd"> | |
<modelVersion>4.0.0</modelVersion> | |
<groupId>com.sivalabs</groupId> | |
<artifactId>hello-angularjs</artifactId> | |
<version>1.0-SNAPSHOT</version> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<title>Hello AngularJS</title> | |
<meta charset="UTF-8"> | |
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.2.23/angular.min.js"></script> | |
</head> | |
<body ng-app> | |
<p>Enter Name: <input type="text" ng-model="myname"> </p> | |
<p>Hello {{myname}}!!</p> | |
</body> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"_links": { | |
"self": { | |
"href": "http://localhost:8080/spring-data-rest-demo/rest/users/{?page,size,sort}", | |
"templated": true | |
}, | |
"search": { | |
"href": "http://localhost:8080/spring-data-rest-demo/rest/users/search" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public interface UserRepository extends JpaRepository<User, Integer> | |
{ | |
} | |
public interface RoleRepository extends JpaRepository<Role, Integer> | |
{ | |
} | |
public interface ContactRepository extends JpaRepository<Contact, Integer> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.sivalabs.springdatarest.web.config; | |
import javax.servlet.Filter; | |
import org.springframework.data.rest.webmvc.config.RepositoryRestMvcConfiguration; | |
import org.springframework.orm.jpa.support.OpenEntityManagerInViewFilter; | |
import org.springframework.web.servlet.support.AbstractAnnotationConfigDispatcherServletInitializer; | |
import com.sivalabs.springdatarest.config.AppConfig; |