Skip to content

Instantly share code, notes, and snippets.

@SergeiGolos
Created November 23, 2012 22:59
Show Gist options
  • Save SergeiGolos/4137647 to your computer and use it in GitHub Desktop.
Save SergeiGolos/4137647 to your computer and use it in GitHub Desktop.
[AngularStudent] Routing? Part1 (index.html)
<html ng-app="ngViewTest">
<head>
<title>
Routing? Part 1 (example 1)
</title>
<link href="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.2.1/css/bootstrap.min.css" rel="stylesheet">
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.0.2/angular.min.js"></script>
<script src="controller.js" type="text/javascript"></script>
</head>
<body>
<div ng-controller="MainCntl">
<div class="navbar navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<a class="brand"
href="#/"
style="padding-top: 6px; padding-bottom: 0px;">Home</a>
<ul class="nav">
<li ng-repeat="link in links">
<a href="#/{{link}}">{{link}}</a>
</li>
</ul>
</div>
</div>
</div>
<div style="margin-top:45px;">
<div ng-view/>
</div>
</div>
</body>
<!-- Preloaded tempaltes for use with routing -->
<script id="about.html"
type="text/ng-template" >
About page, display template with no special values;
</script>
<script id="detailTemplate.html"
type="text/ng-template">
Detail page, display template for detailId = {{test}}
</script>
<script id="home.html"
type="text/ng-template">
Default view when entring the page.
</script>
</html>​
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment