continue work on angular form
This commit is contained in:
@ -145,7 +145,8 @@ exports.getAccount = function(req, res) {
|
||||
title: 'Manage your Free Code Camp Account',
|
||||
challenges: c,
|
||||
ch: req.user.challengesHash,
|
||||
moment: moment
|
||||
moment: moment,
|
||||
user: req.user
|
||||
});
|
||||
});
|
||||
};
|
||||
|
@ -43,9 +43,14 @@ $(document).ready(function() {
|
||||
});
|
||||
|
||||
var profileValidation = angular.module('profileValidation',[]);
|
||||
profileValidation.controller('profileValidationController', ['$scope',
|
||||
function($scope) {
|
||||
$scope.twitterHandle = '@yournamehere';
|
||||
$scope.user.name = req.user.name;
|
||||
profileValidation.controller('profileValidationController', ['$scope', '$http',
|
||||
function($scope, $http) {
|
||||
$http.get('/account').success(function(data) {
|
||||
console.log('============');
|
||||
console.log(data);
|
||||
console.log('============');
|
||||
$scope.user = data.user;
|
||||
});
|
||||
//$scope.user = user;
|
||||
}
|
||||
]);
|
||||
|
@ -4,11 +4,11 @@ block content
|
||||
.container.text-center
|
||||
h1 Update your profile here:
|
||||
form.form-horizontal(action='/account/profile', method='POST')
|
||||
//input(type='hidden', name='_csrf', value=_csrf)
|
||||
//.form-group
|
||||
// label.col-sm-3.col-sm-offset-2.control-label(for='name') Name
|
||||
// .col-sm-4
|
||||
// input.form-control(type='text', name='name', id='name', value='#{user.profile.name}')
|
||||
input(type='hidden', name='_csrf', value=_csrf)
|
||||
.form-group
|
||||
label.col-sm-3.col-sm-offset-2.control-label(for='name') Name
|
||||
.col-sm-4
|
||||
input.form-control(type='text', name='name', id='name', value='#{user.profile.name}')
|
||||
.form-group
|
||||
label.col-sm-3.col-sm-offset-2.control-label(for='name') Name
|
||||
.col-sm-4
|
||||
@ -28,9 +28,9 @@ block content
|
||||
.form-group
|
||||
label.col-sm-3.col-sm-offset-2.control-label(for='email') Twitter Handle
|
||||
.col-sm-4
|
||||
input.form-control(type='text', name='twitterHandle', id='twitterHandle', ng-model="twitterHandle" value='#{user.profile.twitterHandle}')
|
||||
input.form-control(type='text', name='twitterHandle', id='twitterHandle', ng-model="user.twitterHandle" value='#{user.profile.twitterHandle}')
|
||||
span
|
||||
{{twitterHandle}}
|
||||
{{user.twitterHandle}}
|
||||
.form-group
|
||||
label.col-sm-3.col-sm-offset-2.control-label(for='email') Github Profile Link
|
||||
.col-sm-4
|
||||
|
Reference in New Issue
Block a user