Skip to content

Commit

Permalink
first directive
Browse files Browse the repository at this point in the history
  • Loading branch information
zafarali committed Jun 17, 2014
1 parent 7620a2f commit fa0b6c1
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions 03-1-directives.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<!DOCTYPE html>
<html>
<head>
<title>directives</title>
<style>
*{font-family: Tahoma; font-size: 1em;}#wrapper{width:100%;};
#inner{width:50%; margin:0 auto; border:solid black 1px;};
</style>

<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.17/angular.min.js"></script>

<script>
var app = angular.module("myApp", []);
app.directive("calculator", function(){
return {
restrict : "E",
template:"<img src='http://www.stat.osu.edu/~stated/images/calculator.gif'>"
};
});
</script>

</head>
<body ng-app="myApp">
<div id="wrapper">
<calculator></calculator><br />
<calculator></calculator>
</div>
</body>
</html>

0 comments on commit fa0b6c1

Please sign in to comment.