This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function(){ | |
'use strict'; | |
var router = require('./router/router.js'), | |
UsersViewCtrl = require('./controllers/users/view'), | |
UsersNewCtrl = require('./controllers/users/new'), | |
UsersEditCtrl = require('./controllers/users/edit'), | |
angular.module('app', ['ngRoute']) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function bootstrapNick() { | |
var $app, $view, | |
nick = { | |
init: function(){ | |
$app = document.querySelector('[nick-app]'); | |
$view = document.querySelector('[nick-view]'); | |
console.log('inicializado com sucesso'); | |
}, | |
loadView: function(url){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"bold_folder_labels": true, | |
"caret_style": "smooth", | |
"color_scheme": "Packages/Theme - Afterglow/Afterglow-monokai.tmTheme", | |
"file_exclude_patterns": | |
[ | |
"*.lib", | |
".DS_Store", | |
"*~", | |
"*.png", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Car = function(model, color) { | |
this.model = model; | |
this.color = color; | |
} | |
var fusca = new Car('fusca', 'amarelo'); | |
// A partir do construtor clássico os métodos/propriedades são fixos ao momento de criação, o que não é o caso com protótipos. | |
fusca.horn(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var f;"undefined"!=typeof window?f=window:"undefined"!=typeof global?f=global:"undefined"!=typeof self&&(f=self),f.queryObject=e()}}(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(_dereq_,module,exports){ | |
var queryObject = {}; | |
queryObject.strip = function (str) { | |
return str.replace(/^\?/, ''); | |
}; | |
queryObject.destroy = function() { | |
window.location.search = ''; | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function(){ | |
'use strict'; | |
var router = require('./router/router.js'), | |
// serivces | |
ngToast = require('./services/ngToast'), | |
ngOverlay = require('./services/ngOverlay'), | |
Request = require('./services/Request'), | |
scroll = require('./services/scroll'), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function() { | |
'use strict'; | |
module.exports = ['$filter', function($filter){ | |
return { | |
restrict: 'A', | |
link: function(scope, elem, attr) { | |
var options = { | |
field: elem[0] | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
app.factory('Session', [function(){ | |
var set = function(name, data) { | |
sessionStorage.setItem(name, JSON.stringify(data)); | |
} | |
var destroy = function(name) { | |
sessionStorage.removeItem(name); | |
} | |
var get = function(name) { | |
return JSON.parse(sessionStorage.getItem(name)); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
app.factory('AuthService', ['$http', function($http){ | |
checkUser: function(credentials, callback) { | |
$http.get('/auth/check', credential) | |
.success(function(response){ | |
callback(response); | |
}); | |
} | |
}]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// exemplo de data | |
{ | |
token: "Token retornado do back-end", | |
profile: "Perfil retornado do back-end" | |
} | |
app.storeUserData = function(data) { | |
sessionStorage.setItem('userData', JSON.stringify(data)); | |
}; |