Skip to content

Instantly share code, notes, and snippets.

View renatocantarino's full-sized avatar

Renato Cantarino renatocantarino

View GitHub Profile
angular.module("myapp", [])
.controller("MyController", function($scope) {
$scope.eventos = {};
$scope.eventos.Clique = function()
{
alert("evento clique");
}
} );
<!DOCTYPE html>
<html lang="en">
<head>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.5/angular.min.js"></script>
</head>
<body ng-app="myapp">
<div ng-controller="MyController">
<button ng-click="eventos.Clique()"> Clique aqui </button>
</div>
<!DOCTYPE html>
<html >
<head>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.5/angular.min.js"></script>
</head>
<body ng-app="changeExample">
<div ng-controller="ExampleController">
<input type="checkbox" ng-model="confirmed" ng-change="eventos.change()" id="ng-change-example1"> CheckBox </input>
<br/>
</div>
angular.module('changeExample', [])
.controller('ExampleController', ['$scope', function($scope) {
$scope.eventos = {};
$scope.eventos.change = function() {
alert("evento change disparado.")
};
}]);