What's mean "!" in require.js when I included module ? What's syntax ? I what includ dinamic stylesheet in my project and I found https://github.com/martinsb/require-css plugin It's works fine .
require(['css!css/sample.css'], function() {
alert('Stylesheet has been loaded');
});
Why ['css!css/sample.css'] include css.js and css/sample.css ?
Edit:
I know alternative :
define(["controller", "RequireCSS","marionette"],
function (Controller, css, Marionette) {
css.load("default.css");
RequireCSS.js
define(function () {
return {
load: function (url) {
var link = document.createElement("link");
link.type = "text/css";
link.rel = "stylesheet";
link.href = url;
document.getElementsByTagName("head")[0].appendChild(link);
}
}
});