This file contains hidden or 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
<script src="js/all.js"></script> |
This file contains hidden or 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
<!doctype html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<meta name="description" content=""> | |
<meta name="viewport" content="width=device-width,initial-scale=1"> | |
<title>myApp</title> | |
</head> | |
<body ng-app="myApp"> |
This file contains hidden or 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
<div ng-switch="this.isAuthorized"> | |
<div ng-switch-when="true"> | |
Hi, {{authCtrl.userName}}! <button ng-click="authCtrl.logout('twitter');">Logout</button> | |
</div> | |
<div ng-switch-default> | |
<button ng-click="authCtrl.login('twitter');">Twitter</button> | |
</div> | |
</div> |
This file contains hidden or 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
.factory('AuthFactory', function($window){ | |
var hello = $window.hello; | |
var isInited = false; | |
var service = { | |
login: login, | |
isLoggedIn: isLoggedIn | |
}; | |
return service; |
This file contains hidden or 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 express = require('express'), | |
app = express(), | |
bodyParser = require('body-parser'), | |
methodOverride = require('method-override'), | |
morgan = require('morgan'), //HTTP request logger | |
path = require('path'), | |
port = parseInt(process.env.PORT, 10) || 8080, | |
env = process.env.NODE_ENV || 'dev', | |
oauthshim = require('oauth-shim'); |
This file contains hidden or 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(angular) { | |
'use strict'; | |
angular | |
.module('myApp', ['ngRoute']) | |
.directive('auth', function() { | |
var directive = { | |
restrict: 'E', | |
scope: {}, | |
replace: true, |
This file contains hidden or 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'), | |
jsmin = require('gulp-jsmin'); | |
var paths = { | |
js: [ | |
'bower_components/angular/angular.js', | |
'bower_components/angular-route/angular-route.js', | |
'bower_components/hello/dist/hello.all.js', | |
'dev/js/**/*.js' |
This file contains hidden or 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
{ | |
"name": "myApp", | |
"version": "0.0.1", | |
"private": true, | |
"scripts": { | |
"start": "node server" | |
}, | |
"description": "Example of social networks authentication with AngularJS and hello.js", | |
"main": "server.js", | |
"author": "Maslov Dmitry <maslov.dmitrij@gmail.com>", |
This file contains hidden or 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
{ | |
"name": "myApp", | |
"version": "0.0.1", | |
"private": true, | |
"ignore": [ | |
"**/.*", | |
"node_modules", | |
"bower_components" | |
], | |
"dependencies": { |
This file contains hidden or 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 afterTask = function(){ | |
gulp.src(...) | |
.pipe(...) | |
.pipe(gulp.dest(...)); | |
}; | |
gulp.task('some-task', function() { | |
gulp.src(..) | |
.pipe(...) | |
.pipe(gulp.dest(...)) |