// some work on style sheets
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
define(['module'], function (module) {
|
||||
return {
|
||||
type: module.config().id
|
||||
};
|
||||
});
|
||||
@@ -0,0 +1,6 @@
|
||||
define(function (require, exports, module) {
|
||||
return {
|
||||
food: module.config().id
|
||||
};
|
||||
});
|
||||
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
require({
|
||||
config: {
|
||||
a: {
|
||||
id: 'magic'
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
require({
|
||||
baseUrl: './',
|
||||
config: {
|
||||
'b/c': {
|
||||
id: 'beans'
|
||||
}
|
||||
}
|
||||
},
|
||||
['a', 'b/c', 'plain'],
|
||||
function(a, c, plain) {
|
||||
doh.register(
|
||||
'moduleConfig',
|
||||
[
|
||||
function moduleConfig(t){
|
||||
t.is('magic', a.type);
|
||||
t.is('beans', c.food);
|
||||
t.is('plain', plain.id);
|
||||
}
|
||||
]
|
||||
);
|
||||
doh.run();
|
||||
}
|
||||
);
|
||||
@@ -0,0 +1,15 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>require.js: Module Config Test</title>
|
||||
<script type="text/javascript" src="../../require.js"></script>
|
||||
<script type="text/javascript" src="../doh/runner.js"></script>
|
||||
<script type="text/javascript" src="../doh/_browserRunner.js"></script>
|
||||
<script type="text/javascript" src="moduleConfig-tests.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<h1>require.js: Module Config Test</h1>
|
||||
<p>Test passing data to a module via a config config. :)</p>
|
||||
<p>Check console for messages</p>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,6 @@
|
||||
define(function (require, exports, module) {
|
||||
return {
|
||||
//no config, just should get an empty object.
|
||||
id: 'plain' + (module.config().foo || '')
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user