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
# for API and DB endpoints | |
user = require './controllers/userController' | |
mainFeed = require './controllers/mainFeedController' | |
{isLoggedIn} = require './middleWare' | |
{alreadyLoggedOut} = require './middleWare' | |
module.exports = (app, passport) -> | |
#========================= | |
# Routes here!! |
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 gulp = require('gulp'), | |
concat = require('gulp-concat'), | |
plumber = require('gulp-plumber'), | |
server = require('tiny-lr')(), | |
refresh = require('gulp-livereload'), | |
mocha = require('gulp-mocha'), | |
stylus = require('gulp-stylus'), | |
notify = require('gulp-notify'), | |
nodemon = require('gulp-nodemon'), | |
jshint = require('gulp-jshint'), |
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
.config(['$routeProvider', function ($routeProvider) { | |
$routeProvider | |
.when('/', { | |
controller: 'mainController', | |
templateUrl: '/templates/main.html' | |
resolve: { | |
users: function(hrFactory) { | |
return hrFactory.get('/users').then(function(data){ | |
return data.data | |
}) |
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
<link rel="import" href="../paper-progress/paper-progress.html"> | |
<polymer-element name="my-element"> | |
<template> | |
<style> | |
:host { | |
position: absolute; | |
width: 100%; | |
height: 100%; |
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
<link rel="import" href="../components/polymer/polymer.html"> | |
<polymer-element name="my-element"> | |
<template> | |
<style> | |
:host { | |
position: absolute; | |
width: 100%; | |
height: 100%; |
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
// Directives are easy | |
// Two types | |
// * attribute that adds functionality to an element (think jquery shit) | |
// * component (think custom element) | |
// follow below | |
angular.module('directives', []) | |
// ----------------- LEVEL ONE ------------------------------ | |
// this directive will be an attribute directive | |
// we'll add functionality to an element | |
// lets change some css when clicked |
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
import angular from 'angular'; | |
import _ from 'lodash'; | |
let template = ` | |
<div> | |
<h1>{{ data.title }}</h1> | |
<div ng-transclude></div> | |
</div> | |
`; |
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
angular.module('app', ['ui.router']) | |
.config(function($stateProvider){ | |
$stateProvider | |
.state('app', { | |
url: '/app', | |
resolve: { | |
// DataService must be a valid dependecny somewhere | |
// user any valid service | |
// data will be the name of the resolved value | |
data: function(DataService /*, $http, $log, */){ |
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
angular.module('app', []) | |
.controller('AppController', function($scope, Todos, Reddit) { | |
Reddit.getFrontPage() | |
.then(function(posts) { | |
$scope.redditPost = posts; | |
}) | |
$scope.newTodo = ''; | |
$scope.todos = Todos.getState(); | |
$scope.createTodo = function() { |
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
angular.moudle('app', []) | |
.config($stateProvider => { | |
$stateProvider | |
.state('profile', { | |
url: '/profile', | |
template: '<profile-page profile="profile"></profile-page>', | |
controller(profile, $scope){ // use 'function' if minifying | |
$scope.profile = profile; | |
}, | |
resolve: { |
OlderNewer