I want to load a html content with RequireJS like this:
define(function (require) {
"use strict";
return function (id) {
var url = 'text!screens/' + id + '.html';
var html = require(url);
}; });
But I get this error: Error: Module name "text!screens/home.html_unnormalized2" has not been loaded yet for context: _
If I try it in this way:
define(function (require) {
"use strict";
return function () {
var html = require('text!screens/home.html');
}; });
everything is ok. But this approach isn't very nice due to hardcore tipped url. How can I solve this?