Skip to content

Instantly share code, notes, and snippets.

@drissamri
Last active August 29, 2015 14:13
Show Gist options
  • Save drissamri/3939ad7d11dd87a52408 to your computer and use it in GitHub Desktop.
Save drissamri/3939ad7d11dd87a52408 to your computer and use it in GitHub Desktop.
Thymeleaf homepage
<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org" lang="en">
<head>
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes"/>
<title>opt.is linkshortener</title>
<link href="http://cdn.jsdelivr.net/webjars/bootstrap/3.3.1/css/bootstrap.min.css"
th:href="@{/webjars/bootstrap/3.3.1/css/bootstrap.min.css}" rel="stylesheet" media="screen"/>
<link href="../css/app.css" th:href="@{/css/app.css}" rel="stylesheet" media="screen"/>
</head>
<body ng-app="linkApp">
<div ng-controller="LinkController">
<div class="center input-group">
<input type="text" ng-model="longUrl" class="form-control" id="longUrl"
placeholder="Enter a link to shorten it"/>
<span class="input-group-btn">
<button class="btn btn-default" type="button" ng-click="shorten(longUrl)">Shorten!</button>
</span>
</div>
<div id="result" ng-show="link">
You can get to your submitted URL through:
<a ng-href="{{link.shortUrl}}">{{link.shortUrl}}</a>
</div>
</div>
<script src="http://cdn.jsdelivr.net/webjars/angularjs/1.3.8/angular.min.js"
th:src="@{/webjars/angularjs/1.3.8/angular.min.js}"></script>
<script type="text/javascript" src="../js/app.js"
th:src="@{/js/app.js}"></script>
<script type="text/javascript" src="../js/LinkController.js"
th:src="@{/js/LinkController.js}"></script>
<script type="text/javascript" src="../js/LinkService.js"
th:src="@{/js/LinkService.js}"></script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment