Skip to content

Commit

Permalink
adds C directives
Browse files Browse the repository at this point in the history
  • Loading branch information
zafarali committed Jun 17, 2014
1 parent 403aad1 commit 552ae91
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion 03-1-directives.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,22 @@
}
}
});

app.directive("calculus", function(){
return {
restrict:"C",//C for class
link:function(){
alert("lets do some integration!")
}
}
});
</script>

</head>
<body ng-app="myApp">
<div id="wrapper">
<calculator></calculator><br />
<!--Here we give one of our calculators the calculus class.-->
<calculator class="calculus"></calculator><br />
<!--Here we give our calculator attribute the leak attribute which executes the linking function.
We could have just as well added the attribute to any other element-->
<calculator leak></calculator>
Expand Down

0 comments on commit 552ae91

Please sign in to comment.