Skip to content

Instantly share code, notes, and snippets.

View leandroh's full-sized avatar
:shipit:
To deploy or not to deploy?

Leandro Pará leandroh

:shipit:
To deploy or not to deploy?
View GitHub Profile
var express = require('express');
var bodyParser = require('body-parser');
<table data-ng-controller="ProdutosCtrl as ctrl">
<tr>
<th>Produto</th>
<th>Valor</th>
</tr>
<tr data-ng-repeat="produto in ctrl.produtos">
<td>{{ produto.nome }}</td>
<td>{{ produto.valor | currency }}</td>
</tr>
</table>
<table data-ng-controller="ProdutosCtrl as ctrl">
<tr>
<th>Produto</th>
<th>Valor</th>
</tr>
<tr data-ng-repeat="produto in ctrl.produtos">
<td>{{ produto.nome }}</td>
<td>{{ produto.valor }}</td>
</tr>
</table>
@leandroh
leandroh / angular_table.html
Last active February 25, 2016 19:54
Angular ng-repeat table exemplo
<table data-ng-controller="ProdutosCtrl as ctrl">
<tr>
<th>Produto</th>
<th>Valor</th>
</tr>
<tr data-ng-repeat="produto in ctrl.produtos">
<td>{{ produto.nome }}</td>
<td>{{ produto.valor | currency: 'R$ ' }}</td>
</tr>
</table>
@leandroh
leandroh / pg_restore.sh
Created February 25, 2016 17:15
restore psql database
pg_restore --verbose --clean --no-acl --no-owner -h localhost -U leandroh -d database_name db/backup/24-02-2016-10\:08.dump
@leandroh
leandroh / template_diretiva.html
Created February 19, 2016 15:48
Template HTML diretiva
<div>Bem vindo ao mundo das diretivas!</div>
@leandroh
leandroh / template_diretiva.js
Last active February 19, 2016 15:46
Template de uma diretiva no AngularJS
(function() {
'use strict';
angular.module('app', []); // Cria nosso módulo principal
// Cria uma diretiva tendo como parametros uma string e uma function
angular.module('app')
.directive('minhaDiretiva', function() {
return {
@leandroh
leandroh / template_ddo.js
Created February 18, 2016 19:24
AngularJS directive template
{
template: '<div>Bem vindo ao mundo das diretivas!</div>'
}
@leandroh
leandroh / basic_directive.js
Created February 18, 2016 18:30
Exemplo simples de uma pequena diretiva em AngularJS
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Bem vindo ao mundo das diretivas no AngularJS!</title>
</head>
<body ng-app="app">
<minha-diretiva></minha-diretiva>
<script src="https://code.angularjs.org/1.5.0/angular.min.js"></script>
@leandroh
leandroh / directive_definition_object.js
Created February 18, 2016 16:54
Directive Definition Object
var app = angular.module('app', []);
app.directive('webComponent', function factory(dependencias) {
var directiveDefinitionObject = {
priority: 0,
template: '<div></div>', // or // function(tElement, tAttrs) { ... },
// or
// templateUrl: 'directive.html', // or // function(tElement, tAttrs) { ... },
transclude: false,
restrict: 'A',