Is it good practice to use requirejs to extend single pages instead of
pure javascript applications?
pSo my question is mainly about the use case of RequireJS./p pI read a lot
about pure javascript driven web pages. Currently I extend single web
pages (provided by a template engine from any backend) with AngularJS
which adds a lot of value. Sadly the dependency management gets harder and
harder with every codelt;scriptgt;/code tag on other 'single pages'. Even
more when there is a codemain.js/code file which provides common libraries
(e.g. jQuery and AngularJS itself). /p pI thought this doesn't fit into
RequireJS philosophy to have emone main file/em which requires all
dependencies./p pA good example would be an administration panel which
uses some modules (defined by AngularJS's dependencies)./p
pstrongExample:/strong/p precodescripts/ adminpanel/ panel.app.js
panel.filters.js panel.directives.js antoherModule/ andAntoherModule/
require.js /code/pre h3tl;dr/h3 pWhen you use AngularJS to extend single
pages, instead of building a completely javascript driven web application,
is it good practice to use RequireJS for AMD loading modules which will be
used on the single page ? And how is the best way to do it so ?/p
No comments:
Post a Comment