Skip to content

Instantly share code, notes, and snippets.

Ken Miyamoto miyamotodev123

Block or report user

Report or block miyamotodev123

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View keybase.md

Keybase proof

I hereby claim:

  • I am miyamotodev123 on github.
  • I am kmiyamoto (https://keybase.io/kmiyamoto) on keybase.
  • I have a public key ASC_hAj0SX345Rd46nryGey7Ddjc-n7SzcM3TSGthUfPuQo

To claim this, I am signing this object:

View auth_set_up_and_testing.views.login2.html
<div class="col-sm-6 col-sm-offset-3">
<h1><span class="fa fa-sign-in"></span> Login</h1>
<div growl></div>
<!-- LOGIN FORM -->
<form ng-submit="login.login()" ng-controller="LoginControllerTwo as login">
<div class="form-group">
<label>Email</label>
View auth_set_up_and_testing.js.controllers.login3.js
(function() {
angular.module('app')
// injected 'growl' as a dependency to be used by the LoginController
.controller('LoginController', ['$location', 'AuthService', 'growl',
function($location, AuthService, growl) {
var vm = this;
vm.login = function() {
var login_data = {
email: vm.email,
View auth_set_up_and_testing.js.app2.js
// defining our angular app, the first arguement is the name of our application
// second argument is an array that loads the dependencies into the application
(function() {
angular.module('app', ['ngRoute', 'angular-growl']);
})();
View auth_set_up_and_testing.lib.growl.js
(function() {
/**
* angular-growl - v0.4.0 - 2013-11-19
* https://github.com/marcorinck/angular-growl
* Copyright (c) 2013 Marco Rinck; Licensed MIT
*/
angular.module('angular-growl', []);
angular.module('angular-growl').directive('growl', [
'$rootScope',
function ($rootScope) {
View auth_set_up_and_testing.views.index2.html
<!doctype html>
<html ng-app="app">
<head>
<title>Node Authentication</title>
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.0.2/css/bootstrap.min.css">
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.15/angular.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.15/angular-route.min.js"></script>
<script src="lib/growl.js"></script>
View auth_set_up_and_testing.js.factories.authentication.service.js
(function() {
angular.module('app')
.factory('AuthService', ['$http',
function($http) {
var AuthService = {};
AuthService.login = function(data) {
return $http.post('/login', data)
}
View auth_set_up_and_testing.js.controllers.login2.js
(function() {
angular.module('app')
.controller('LoginController', ['$location', 'AuthService',
function($location, AuthService) {
var vm = this;
vm.login = function() {
var login_data = {
email: vm.email,
password: vm.password
View auth_set_up_and_testing.js.directives.logout.directive.js
(function(){
angular.module('app')
.directive('logout', ['$http', function($http) {
return {
restrict: 'A',
link: function(scope, element, attrs) {
element.on('click', function(e) {
$http.post('/logout');
});
}
View auth_set_up_and_testing.js.controllers.profile.client.controller.js
(function() {
angular.module('app')
.controller('ProfileController', ['$http', '$scope', '$location',
function($http, $scope, $location) {
$http.get('/api/userData')
.success(function(response) {
console.log('user data success')
console.log(response)
$scope.user = response; //Expose the user data to your angular scope
})
You can’t perform that action at this time.