Confirmed users
502
edits
| Line 48: | Line 48: | ||
== Modules in Settings == | == Modules in Settings == | ||
=== Define Modules === | === Define Modules === | ||
Settings modules are AMD modules. In addition to following the syntax of AMD modules, settings app also requires the returning object not to be a constructor function. The reason is that we are then able to expect that all returning functions can be used without the "new" keyword. The other advantage is that the returning functions can be seen as factory methods. A factory method can return different type of objects based on the parameters, which | Settings modules are AMD modules. In addition to following the syntax of AMD modules, settings app also requires the returning object not to be a constructor function. The reason is that we are then able to expect that all returning functions can be used without the "new" keyword. The other advantage is that the returning functions can be seen as factory methods. A factory method can return different type of objects based on the parameters, which is useful in some use cases. | ||
=== Configure Requirejs === | === Configure Requirejs === | ||