Skip to content

Instantly share code, notes, and snippets.

View joncodo's full-sized avatar
😎

Jonathan O'Donnell joncodo

😎
  • Altan Insights
  • Fredericton, NB
View GitHub Profile
<!DOCTYPE html>
<html data-ng-app>
<head>
<script src="/bower_components/angular/angular.js"></script>
</head>
<body>
<input ng-controller="DemoController"/>
<div>
@joncodo
joncodo / Angular-stackoverflow-23498356.markdown
Created November 26, 2014 18:43
Angular stackoverflow 23498356
<div data-ng-controller="navController">
<div id="user" data-ng-class="{ 'student' : currentUser.user_type === 'student' }">
<div>
<div class="userName">
<i class="user-icon"></i>
{{ currentUser.first_name + " " + currentUser.last_name }}
{{ currentUser.first_name == null ? 'My User' : ''}}
<a href="/#/logout/" class="logout"><i></i>Logout</a>
</div>
<div class="helpCircle">
myApp.controller('navController', function ($scope, $rootScope, $http, $location, UtilService) {
$scope.userResults = [];
$scope.searchPerformed = false;
$scope.searchToggled = false;
if ( !$rootScope.currentUser && UtilService.retrieve('x-access-token') ) {
console.log('Route changed and there is no current user set. Also, there now IS a token. Getting current user...');
$http.get('/me')
.success(function(data, status, headers, config) {
$rootScope.currentUser = {
console.log('in the create');
Application.create(app).exec(function(err, createdApp) {
if ( err || !createdApp ) {
console.log('error was', err);
}
console.log('app created');
return res.send(200);
});
Great job kevin!