You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
>The composite pattern is a partitioning design pattern. The composite pattern describes that a group of objects are to be treated in the same way as a single instance of an object. The intent of a composite is to "compose" objects into tree structures to represent part-whole hierarchies.
According to the Gang of Four, MVC is nothing more than combination of:
622
+
Gang of Fourによると、MVCは次の組み合わせであるに過ぎないということです:
623
623
624
-
-Strategy
625
-
-Composite
626
-
-Observer
624
+
-ストラテジ
625
+
-コンポジット
626
+
-オブザーバ
627
627
628
-
They state that the view is composition of components. In AngularJS the situation is similar. Our views are formed by a composition of directives and DOM elements, on which these directives could be applied.
@@ -656,11 +656,11 @@ myModule.directive('zippy', function () {
656
656
});
657
657
```
658
658
659
-
This example defines a simple directive, which is a UI component. The defined component (called "zippy") has header and content. Click on its header toggles the visibility of the content.
From the first example we can note that the whole DOM tree is a composition of elements. The root component is the `html`element, directly followed by the nested elements `head`and`body`and so on...
In the second, JavaScript, example we see that the `template`property of the directive, contains markup with `ng-transclude`directive inside it. So this means that inside the directive `zippy`we have another directive called `ng-transclude`, i.e. composition of directives. Theoretically we can nest the components infinitely until we reach a leaf node.
0 commit comments