Skip to content

Instantly share code, notes, and snippets.

@nblenke
Created February 19, 2014 15:23
Show Gist options
  • Select an option

  • Save nblenke/9094192 to your computer and use it in GitHub Desktop.

Select an option

Save nblenke/9094192 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html lang="en" ng-app="app">
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
<head>
<title>Angular Template Example</title>
<style>
.viewer {width:240px;height:280px;margin:10px;float:left;border:1px solid red}
.viewer nav {width:100%;height:50px;border:1px solid green}
.viewer nav a {width:30px;height:30px;float:left;margin:5px;border:1px solid orange}
.viewer aside {width:90px;height:210px;margin:5px 0 0;float:left;border:1px solid purple}
.viewer aside a {width:30px;height:30px;float:left;margin:5px;border:1px solid orange}
.viewer main {width:135px;height:210px;float:left;margin:5px;border:1px solid orange}
</style>
</head>
<body>
<div class="viewer" ng-view></div>
<div class="viewer" ng-view></div>
<div class="viewer" ng-view></div>
<!-- templates -->
<script id="tmpl-home" type="text/ng-template">
<nav>
<a href="" data-pcc-tool="pan"></a>
<a href="" data-pcc-tool="magnifier"></a>
<a href="" data-pcc-tool="zoom"></a>
<a href="" data-pcc-tool="textSelect"></a>
</nav>
<aside>
<a href="" data-pcc-tool="line"></a>
<a href="" data-pcc-tool="rectangle"></a>
<a href="" data-pcc-tool="stamp"></a>
<a href="" data-pcc-tool="ellipse" ng-click='go()'></a>
</aside>
<main>
main
</main>
</script>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.0/angular.min.js"></script>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.0/angular-route.min.js"></script>
<script type="text/javascript">
/*jslint browser: true, devel: true, nomen: true */
/*globals angular */
(function () {
'use strict';
var app = angular.module('app', ['ngRoute']);
app.config(function ($routeProvider) {
$routeProvider.when('/', {
templateUrl: 'tmpl-home',
controller: 'HomeController'
});
$routeProvider.otherwise({
redirectTo: '/'
});
});
app.controller('HomeController', function ($scope) {
$scope.Hello = 'Hello There!';
$scope.Message = 'This is a test.';
$scope.go = function () {
alert('bar');
};
});
}());
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment