Created
August 20, 2013 11:19
-
-
Save eduardo-matos/6280193 to your computer and use it in GitHub Desktop.
Detecção de características da loja
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
define('loja', ['dojo/has'], function (has) { | |
var id = 123; | |
var pagina = 'departamento' | |
var depto = 'eletronicos' | |
has.add('loja-id-' + id, true); | |
has.add('loja-pagina-' + pagina, true); | |
has.add('loja-depto-' + depto, true); | |
return has; | |
}); | |
require(['loja'], function (has) { | |
if(has('loja-id-456')) { | |
console.log('loja 456'); | |
} else { | |
console.log('loja que não é 456'); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment