Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
file 80 lines (60 sloc) 1.788 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80
<!doctype html>
<html ng-app="Demo">
<head>
<meta charset="utf-8" />

<title>Using Controllers In Directives In AngularJS</title>

<link rel="stylesheet" type="text/css" href="app/css/demo.css"></link>
</head>
<body>

<h1>
Using Controllers In Directives In AngularJS
</h1>


<!-- BEGIN: Master Canvas. -->
<div
ng-controller="MasterController"
bn-master
class="master">


<!-- BEGIN: Slave Handles. -->
<ol class="handles">
<li
ng-repeat="slave in slaves"
ng-controller="SlaveController"
bn-slave
class="slave"
ng-style="{ left: ( slave.x + 'px' ), top: ( slave.y + 'px' ) }">

{{ slave.id }}

</li>
</ol>
<!-- END: Slave Handles. -->


<!-- BEGIN: Slave Leaderboard. -->
<ol class="leaderboard">
<li ng-repeat="slave in slaves">

<div class="label">
{{ slave.id }}
</div>

<div class="position">
<span class="coordinate">{{ slave.x }}px</span>
<span class="coordinate">{{ slave.y }}px</span>
</div>

</li>
</ol>
<!-- END: Slave Leaderboard. -->


</div>
<!-- END: Master Canvas. -->


<!-- Load jQuery and AngularJS from the CDN. -->
<script
type="text/javascript"
src="//code.jquery.com/jquery-1.9.0.min.js">
</script>
<script
type="text/javascript"
src="//ajax.googleapis.com/ajax/libs/angularjs/1.0.2/angular.min.js">
</script>

<!-- Load the app module and its classes. -->
<script type="text/javascript" src="app/main.js"></script>
<script type="text/javascript" src="app/controllers/master-controller.js"></script>
<script type="text/javascript" src="app/controllers/slave-controller.js"></script>
<script type="text/javascript" src="app/directives/master.js"></script>
<script type="text/javascript" src="app/directives/slave.js"></script>

</body>
</html>
Something went wrong with that request. Please try again.