Skip to content

Instantly share code, notes, and snippets.

View renatocantarino's full-sized avatar

Renato Cantarino renatocantarino

View GitHub Profile
angular.module('changeExample', [])
.controller('ExampleController', ['$scope', function($scope) {
$scope.eventos = {};
$scope.eventos.change = function() {
alert("evento change disparado.")
};
}]);
<!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>
<!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>
angular.module("myapp", [])
.controller("MyController", function($scope) {
$scope.eventos = {};
$scope.eventos.Clique = function()
{
alert("evento clique");
}
} );
<!DOCTYPE html>
<html ng-app="myApp">
<head lang="en">
<meta charset="utf-8">
<title>Grid Angular</title>
<link rel="stylesheet" type="text/css" href="http://angular-ui.github.com/ng-grid/css/ng-grid.css" />
<link rel="stylesheet" type="text/css" href="css/style.css" />
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.0.2/angular.min.js"></script>
<script type="text/javascript" src="http://angular-ui.github.com/ng-grid/lib/ng-grid.debug.js"></script>
var app = angular.module('myApp', ['ngGrid']);
app.controller('MyCtrl', function($scope) {
$scope.gridOptions = {
data: 'myData',
enablePinning: true,
columnDefs: [{ field: "Nome", width: 120 },
{ field: "idade", width: 120 },
{ field: "Nascimento", width: 120 },
{ field: "Mesada", width: 120 }]
};
.gridStyle {
border: 1px solid rgb(212,212,212);
width: 40%;
height: 300px
}
.ui-grid{border:1px solid #d4d4d4;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;-webkit-transform:translateZ(0);-moz-transform:translateZ(0);-o-transform:translateZ(0);-ms-transform:translateZ(0);transform:translateZ(0)}.ui-grid-vertical-bar{position:absolute;right:0;width:0}.ui-grid-header-cell:not(:last-child) .ui-grid-vertical-bar,.ui-grid-cell:not(:last-child) .ui-grid-vertical-bar{width:1px}.ui-grid-header-cell:not(:last-child) .ui-grid-vertical-bar{background-color:#d4d4d4}.ui-grid-cell:not(:last-child) .ui-grid-vertical-bar{background-color:#d4d4d4}.ui-grid-header-cell:last-child .ui-grid-vertical-bar{right:-1px;width:1px;background-color:#d4d4d4}.ui-grid-clearfix:before,.ui-grid-clearfix:after{content:"";display:table}.ui-grid-clearfix:after{clear:both}.ui-grid-invisible{visibility:hidden}.ui-grid-top-panel-background{background:#f3f3f3;background:-webkit-gradient(linear, left bottom, left top, color-stop(0, #eee), color-stop(1, #fff));background:-ms-linear-gradient(bottom, #eee, #fff);
var m = {
"1" : "Eu",
"2": "tu",
"3" : "ele/ela",
"4" : "nós",
"5": "vós",
"6" : "eles/elas"
};
function MyCtrl($scope) {
@renatocantarino
renatocantarino / gist:b4ee16cf65d095a22087
Created August 30, 2014 19:50
AngularJS ng-Repeat v 2.0
<html data-ng-app="">
<head>
<title>NGREPEAT Versao 2.0</title>
<meta charset="UTF-8">
</head>
<body>
<h3>Lista de Pronomes</h3>
<div ng-app ng-controller="MyCtrl">
<ul>
<li ng-repeat="(Id,pronome) in items">{{Id}}: {{pronome}}</li>