Skip to content

Commit 552ae91

Browse files
committed
adds C directives
1 parent 403aad1 commit 552ae91

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

03-1-directives.html

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,22 @@
2626
}
2727
}
2828
});
29+
30+
app.directive("calculus", function(){
31+
return {
32+
restrict:"C",//C for class
33+
link:function(){
34+
alert("lets do some integration!")
35+
}
36+
}
37+
});
2938
</script>
3039

3140
</head>
3241
<body ng-app="myApp">
3342
<div id="wrapper">
34-
<calculator></calculator><br />
43+
<!--Here we give one of our calculators the calculus class.-->
44+
<calculator class="calculus"></calculator><br />
3545
<!--Here we give our calculator attribute the leak attribute which executes the linking function.
3646
We could have just as well added the attribute to any other element-->
3747
<calculator leak></calculator>

0 commit comments

Comments
 (0)