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
/* jshint validthis: true */ | |
var vm = this; |
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
/* A éviter */ | |
function Sessions() { | |
var vm = this; | |
vm.gotoSession = function() { | |
/* ... */ | |
}; | |
vm.refresh = function() { | |
/* ... */ | |
}; | |
vm.search = function() { |
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
/* A éviter */ | |
function Sessions(data) { | |
var vm = this; | |
vm.gotoSession = gotoSession; | |
vm.refresh = function() { | |
/** | |
* les | |
* multiples | |
* lignes |
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
/** | |
* A éviter | |
*/ | |
function Avengers(dataservice, logger) { | |
var vm = this; | |
vm.avengers = []; | |
vm.title = 'Avengers'; | |
var activate = function() { | |
return getAvengers().then(function() { |
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
/** | |
* Recommandé | |
*/ | |
function Avengers(dataservice, logger) { | |
var vm = this; | |
vm.avengers = []; | |
vm.getAvengers = getAvengers; | |
vm.title = 'Avengers'; | |
activate(); |
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
/* A éviter */ | |
function Order ($http, $q) { | |
var vm = this; | |
vm.checkCredit = checkCredit; | |
vm.total = 0; | |
function checkCredit () { | |
var orderTotal = vm.total; | |
return $http.get('api/creditcheck').then(function (data) { | |
var remaining = data.remaining; |
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
/* A éviter - quand on souhaite utiliser les routes */ | |
// route-config.js | |
angular | |
.module('app') | |
.config(config); | |
function config ($routeProvider) { | |
$routeProvider | |
.when('/avengers', { |
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
/* Recommandé */ | |
// route-config.js | |
angular | |
.module('app') | |
.config(config); | |
function config ($routeProvider) { | |
$routeProvider | |
.when('/avengers', { |
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
// service | |
angular | |
.module('app') | |
.service('logger', logger); | |
function logger () { | |
this.logError = function (msg) { | |
/* */ | |
}; | |
} |
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
/* A éviter */ | |
function dataService () { | |
var someValue = ''; | |
function save () { | |
/* */ | |
}; | |
function validate () { | |
/* */ | |
}; |