Below we have an example controller that has several methods for geometric calculations on a right triangle.
app.controller('TriangleController', ['$scope', function ($scope) {
// here we have a triangle object
$scope.triangle = {
base: undefined,
height: undefined
};
$scope.findArea = function () {
$scope.area = 0.5 * $scope.triangle.base * $scope.triangle.height
};
$scope.