diff options
author | Ammar Alakkad <aalakkad@gitlab.com> | 2019-07-09 13:11:36 +0000 |
---|---|---|
committer | Ammar Alakkad <aalakkad@gitlab.com> | 2019-07-09 13:11:36 +0000 |
commit | feb2e0fc9be618412357ad590c9fc770b94f1131 (patch) | |
tree | e5bf2199df37ce726810ecbbad1a0b1a8f467dd9 | |
parent | 8ae4e24255f75e25ddb0a594244b0e4eba8ebd80 (diff) | |
download | gitlab-ce-aalakkad-master-patch-20574.tar.gz |
Update doc/development/fe_guide/design_patterns.mdaalakkad-master-patch-20574
-rw-r--r-- | doc/development/fe_guide/design_patterns.md | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/doc/development/fe_guide/design_patterns.md b/doc/development/fe_guide/design_patterns.md index 0342d16a87c..2f372f783f5 100644 --- a/doc/development/fe_guide/design_patterns.md +++ b/doc/development/fe_guide/design_patterns.md @@ -53,6 +53,7 @@ When writing a class that needs to manipulate the DOM guarantee a container opti This is useful when we need that class to be instantiated more than once in the same page. Bad: + ```javascript class Foo { constructor() { @@ -63,6 +64,7 @@ new Foo(); ``` Good: + ```javascript class Foo { constructor(opts) { @@ -72,6 +74,7 @@ class Foo { new Foo({ container: '.my-element' }); ``` + You can find an example of the above in this [class][container-class-example]; [container-class-example]: https://gitlab.com/gitlab-org/gitlab-ce/blob/master/app/assets/javascripts/mini_pipeline_graph_dropdown.js |