Skip to content
Snippets Groups Projects
Commit f022c94f authored by David Findlay's avatar David Findlay
Browse files

Included Angular-UI-Bootstrap

parent 7e1cf0d9
No related branches found
No related tags found
No related merge requests found
......@@ -2,20 +2,47 @@
<html lang="en">
<head>
<meta charset="utf-8">
<title>My AngularJS App</title>
<title>eProgram</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, shrink-to-fit=no, initial-scale=1">
<link rel="shortcut icon" type="image/png" href="@routes.Assets.versioned("img/favicon.png")">
<link rel="stylesheet" href="/lib/bootstrap/css/bootstrap.css">
<link rel="stylesheet" href="@routes.Assets.versioned("css/app.css")">
<script data-main="@routes.Assets.versioned("js/main.js")" src="@routes.Assets.versioned("lib/requirejs/require.js")"></script>
</head>
<body>
<ul class="menu">
<nav class="navbar navbar-default navbar-fixed-top">
<div class="container">
<li>
<a href="#" ng-click="toggleStyle()">
<em class="fa fa-navicon">
Menu
</em>
</a>
</li>
</div>
</nav>
<div id="wrapper">
<div id="sidebar-wrapper">
<ul class="sidebar-nav">
<li><a href="#/view1">view1</a></li>
<li><a href="#/view2">view2</a></li>
</ul>
</div>
<div id="page-content-wrapper">
<div ng-view></div>
<div>Angular seed app: v<span app-version></span></div>
</div>
</div>
</body>
</html>
\ No newline at end of file
......@@ -3,9 +3,11 @@ name := """eprogram2"""
version := "1.0-SNAPSHOT"
libraryDependencies ++= Seq(
"org.webjars" % "angularjs" % "1.3.0-beta.2",
"org.webjars" % "requirejs" % "2.1.11-1",
javaJpa, "org.hibernate" % "hibernate-entitymanager" % "5.2.2.Final"
"org.webjars" % "angularjs" % "1.5.8",
"org.webjars.bower" % "angular-animate" % "1.5.8",
"org.webjars.bower" % "angular-touch" % "1.5.8",
"org.webjars" % "angular-ui-bootstrap" % "1.3.3",
"org.webjars" % "requirejs" % "2.1.11-1"
)
lazy val root = (project in file(".")).enablePlugins(PlayScala)
......
/* app css stylesheet */
.menu {
list-style: none;
border-bottom: 0.1em solid black;
margin-bottom: 2em;
padding: 0 0 0.5em;
#wrapper {
width: 100%;
margin: 0 0 0 0;
padding: 0 0 0 0;
}
.menu:before {
content: "[";
#sidebar-wrapper {
width: 250px;
}
.menu:after {
content: "]";
}
.menu > li {
display: inline;
}
.menu > li:before {
content: "|";
padding-right: 0.3em;
}
.menu > li:nth-child(1):before {
content: "";
padding: 0;
#page-content-wrapper {
width: 100%;
position: absolute;
padding: 15px;
}
\ No newline at end of file
......@@ -6,7 +6,7 @@ define(['angular'], function(angular) {
/* Directives */
angular.module('myApp.directives', []).
angular.module('eprogram2.directives', []).
directive('appVersion', ['version', function(version) {
return function(scope, elm, attrs) {
elm.text(version);
......
......@@ -6,7 +6,7 @@ define(['angular'], function(angular) {
/* Filters */
angular.module('myApp.filters', []).
angular.module('eprogram2.filters', []).
filter('interpolate', ['version', function(version) {
return function(text) {
return String(text).replace(/\%VERSION\%/mg, version);
......
......@@ -5,7 +5,8 @@
requirejs.config({
paths: {
'angular': ['../lib/angularjs/angular'],
'angular-route': ['../lib/angularjs/angular-route']
'angular-route': ['../lib/angularjs/angular-route'],
'ui-bootstrap':['../lib/angular-ui-bootstrap/ui-bootstrap']
},
shim: {
'angular': {
......@@ -14,22 +15,28 @@ requirejs.config({
'angular-route': {
deps: ['angular'],
exports : 'angular'
},
'ui-bootstrap': {
deps: ['angular'],
exports: 'ui-bootstrap'
}
}
});
require(['angular', './controllers', './directives', './filters', './services', 'angular-route'],
require(['angular', './controllers', './directives', './filters', './services', 'angular-route', "ui-bootstrap"],
function(angular, controllers) {
// Declare app level module which depends on filters, and services
angular.module('myApp', ['myApp.filters', 'myApp.services', 'myApp.directives', 'ngRoute']).
angular.module('eprogram2', ['eprogram2.filters', 'eprogram2.services', 'eprogram2.directives', 'ngRoute']).
config(['$routeProvider', function($routeProvider) {
$routeProvider.when('/view1', {templateUrl: 'partials/partial1.html', controller: controllers.MyCtrl1});
$routeProvider.when('/view2', {templateUrl: 'partials/partial2.html', controller: controllers.MyCtrl2});
$routeProvider.otherwise({redirectTo: '/view1'});
}]);
angular.bootstrap(document, ['myApp']);
angular.module('eprogram2', ['ui.bootstrap']);
angular.bootstrap(document, ['eprogram2']);
});
......@@ -8,7 +8,7 @@ define(['angular'], function(angular) {
// Demonstrate how to register services
// In this case it is a simple value service.
angular.module('myApp.services', []).
angular.module('eprogram2.services', []).
value('version', '0.1');
});
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment