Skip to content

Instantly share code, notes, and snippets.

View gabrielfeitosa's full-sized avatar
🖥️

Gabriel Feitosa gabrielfeitosa

🖥️
View GitHub Profile
@gabrielfeitosa
gabrielfeitosa / nome.html
Last active August 29, 2015 14:26
Exemplo inicial AngularJS
<!DOCTYPE html>
<html ng-app>
<head>
<meta charset="utf-8">
</head>
<body>
<input type="text" ng-model="nome" placeholder="Diz teu nome aí">
<h1>Eita {{nome}}, olha o two-way data binding funcionando!</h1>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.3/angular.min.js"></script>
@gabrielfeitosa
gabrielfeitosa / controller1.html
Last active August 29, 2015 14:27
Iniciando com Controller no AngularJS
<!DOCTYPE html>
<!--Declaração do módulo da aplicação-->
<html ng-app="app">
<head>
<meta charset="utf-8">
<title>Exemplo 1 - Blog do Gabriel Feitosa</title>
</head>
<body>
@gabrielfeitosa
gabrielfeitosa / controller2.html
Last active August 29, 2015 14:27
Iniciando com Controller no AngularJS - Adicionando comportamento ao $scope
<!DOCTYPE html>
<html ng-app="app">
<head>
<meta charset="utf-8" />
<title>Exemplo 2 - Blog do Gabriel Feitosa</title>
</head>
<body>
<h1>Entendendo os Controladores</h1>
@gabrielfeitosa
gabrielfeitosa / controller_heranca.html
Last active August 29, 2015 14:27
Entendendo os Controladores - Herança de $scope
<!DOCTYPE html>
<!--Declaração do módulo da aplicação-->
<html ng-app="app">
<head>
<meta charset="utf-8"/>
<title>Exemplo 3 - Blog do Gabriel Feitosa</title>
<style type="text/css">
div.heranca div {
padding: 5px;
border: solid 2px #000;
@gabrielfeitosa
gabrielfeitosa / service_alert.html
Last active August 29, 2015 14:27
Utilizando Services no AngularJS
<!DOCTYPE html>
<html ng-app="app">
<head>
<meta charset="utf-8" />
<title>Blog do Gabriel Feitosa</title>
</head>
<body>
<h1>Usando o service $window</h1>
<!--Declaração do controlador AlertController e definição do nome que será usado para utilização 'ctrl'-->
<div ng-controller="AlertController as ctrl">
@gabrielfeitosa
gabrielfeitosa / service_fofoqueiro.html
Last active August 29, 2015 14:27
AngularJS: Criando Service
<!DOCTYPE html>
<html ng-app="app">
<head>
<meta charset="utf-8" />
<title>Blog do Gabriel Feitosa</title>
<style type="text/css">
button {
background-color: red;
color: white;
font-weight: bold;
@gabrielfeitosa
gabrielfeitosa / animal.detalhe.controller.js
Last active September 11, 2015 00:25
AngularJS: Rotas (ngRoute)
(function() {
'use strict';
angular.module('feira-app')
.controller('AnimalDetalheController', AnimalDetalheController);
AnimalDetalheController.$inject = ['$scope', '$routeParams', 'AnimalFactory'];
function AnimalDetalheController($scope, $routeParams, AnimalFactory) {
$scope.titulo = 'Detalhe do Animal';
@gabrielfeitosa
gabrielfeitosa / app.js
Last active September 18, 2015 11:53
AngularJS: Filtros
(function() {
'use strict';
angular.module('app-filters', []);
angular.module('app-filters').filter('cpf', function() {
return function(input) {
var str = input + '';
if(str.length <= 11){
str = str.replace(/\D/g, '');
str = str.replace(/(\d{3})(\d)/, "$1.$2");
@gabrielfeitosa
gabrielfeitosa / bower.json
Last active September 25, 2015 02:27
Arquivo exemplo do bower.json
{
"name": "bower-exemplo",
"version": "0.0.0",
"homepage": "https://github.com/gabrielfeitosa/blog_exemplos",
"authors": [
"Gabriel Feitosa <gabfeitosa@gmail.com>"
],
"description": "",
"main": "",
"moduleType": [],
@gabrielfeitosa
gabrielfeitosa / chatfactory.js
Last active November 11, 2015 18:39
Chat Periodic Refresh
(function() {
angular.module("app")
.factory("ChatFactory", function($http, $timeout) {
var promise;
var URL = "http://gf-chat.herokuapp.com/rest/mensagens/";
var mensagens = [];
var aberto = false;
var contador = 5;
return {