This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div ng-app="app" ng-controller="controller"> | |
<div> | |
<input type="number" ng-model="number" /> | |
<button ng-click="square()"> | |
Square | |
</button> | |
</div> | |
<div> | |
Result: {{result}} | |
</div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
app.service('Calc',function(MathFactory){ | |
this.square = function(a){ | |
return MathFactory.multiply(a,a); | |
} | |
}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var app = angular.module('app',[]); | |
app.factory('MathFactory',function(){ | |
var factory = {}; | |
factory.add = function(a,b){ | |
return a + b; | |
} | |
factory.subtraction = function(a,b){ | |
return a - b; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div ng-app="app" ng-controller="geomeetricShapesController"> | |
<div> | |
Title: <b>{{title}}</b> | |
</div> | |
<hr /> | |
<div ng-controller="circleController"> | |
<div> | |
Name: {{name}} - {{title}} | |
</div> | |
<div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
app.controller('circleController',function($scope){ | |
$scope.name = "Circle"; | |
$scope.formula = "A = PI * r ^ 2"; | |
$scope.area = function(){ | |
return Math.PI * Math.pow($scope.radius,2) | |
} | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div ng-app="app"> | |
<div ng-controller="addController"> | |
<a href="#add">Add</a> | |
<a href="#create">Create</a> | |
<a href="#update">Update</a> | |
<hr /> | |
<div ng-view></div> | |
</div> | |
<!-- View List --> | |
<script type = "text/ng-template" id = "add.htm"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div ng-app = "app"> | |
<script type = "text/ng-template" id = "agregarEstudiante.htm"> | |
<h2> Agregar Estudiante </h2> | |
{{mensaje}} | |
</script> | |
</div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div ng-app = "mainApp"> | |
<div ng-view></div> | |
</div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div ng-app="app" ng-controller="userController"> | |
<table border="1"> | |
<tr> | |
<th>ID</th> | |
<th>First Name</th> | |
<th>Last Name</th> | |
</tr> | |
<tr ng-repeat="value in users"> | |
<td>{{value.id}}</td> | |
<td>{{value.firstName}}</td> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div ng-app = "" ng-controller = "EstudianteControlador"> | |
<div ng-include = "'principal.htm'"></div> | |
<div ng-include = "'asignaturas.htm'"></div> | |
</div> |