javascript - When Loading html file with require.js error with extension -


i have file

reg.html

<label>name:</label> 

in require.config :

requirejs.config({   paths: {  reg:"/templates/reg.html" }  }) 

when try load template :

define('ng_start',["angular","jquery","reg"],function(an,$,template){ .... }) 

get /templates/registry.html.js?bust=1417489939824228.12310815788805 require.js:166 uncaught error: script error for: registry http://requirejs.org/docs/errors.html#scripterror

how deleted js extension registry.html.js ?

you need state "reg" module loaded text , not javascript module. see following details:

https://github.com/requirejs/text

your specific code should read:

define('ng_start',["angular","jquery","text!reg"],function(an,$,template){ .... }) 

note: addition of text! in module definition requirements reg.


Comments

Popular posts from this blog

ruby on rails - RuntimeError: Circular dependency detected while autoloading constant - ActiveAdmin.register Role -

c++ - OpenMP unpredictable overhead -

javascript - Wordpress slider, not displayed 100% width -