javascript - what is the difference between require and require -
What is the difference between the two without almonds?
is required (requires 'module'
(['module']);
edited
Which are nested:
defined (function () {requires ('module');}
define (function () {required (['module'])}}
returns a needjs error (which suggests using the ladder) .
The reason I am asking,
I
> The Library Module gives the main module. In this example, it uses almonds for the requirement of But I do not use almonds and require the Exported Library Object, I mean edit How do I use nested properly So that: Edit file: principium.js
/ ** * The main module which provides Defines, / / defines the public interface for piimo (function (requirement) {convert = needed ('principium / convert'); // return module value. Return {convert: convert};} );
File: lib / main.js
Define (function () {// use special top-level almonds, get synchronous // to get the last module value When required, and export it as a public // value. Requires return ('Principium'); });
principium
( returns required ('principium')
) I hope the exporter library object to back it up. ('principium')
syntax error, and if I use ([' Instead, the exported Library Object does not return.
return {convert: convert};
back to Principium.js
.
and restructured
file: lib / main.js
(define [], Function () {Return Required ('Principium');});
This is the "latter", why F it climbs up to reach to reach the section after the two options, ladders are not, which is a thing that you height otherwise impossible or down.
That way, "the more you know" the same: if you are using need.js, then you just need a module: Dependency Load to run the required.js function Therefore, syntax is:
is required (['dependency 1', 'dependency 1', ...], function codatoron (Dipa 1, dipa 2) { ...});
Your job is dependent on code dependency 1
, etc., and therefore you need to "load" that code, and it should be used on the variable The function that is provided in the form should also be run.
Just in a module it is required without the need for anything, there is no requirement, which is required. JS can tell, so it throws an error.
Comments
Post a Comment