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
Copy file name to clipboardExpand all lines: README.md
+41-4Lines changed: 41 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -573,7 +573,7 @@ Since Martin Fowler states that
573
573
574
574
`$resource` does not implements exactly the Active Record pattern, since it communicates with RESTful service instead of the database. Anyway, we can consider it as "Active Record like RESTful communication".
575
575
576
-
### Partials
576
+
### Directives
577
577
578
578
#### Composite
579
579
@@ -618,19 +618,19 @@ myModule.directive('zippy', function () {
618
618
});
619
619
```
620
620
621
-
This example defines a simple directive, which defines a UI component. The defined component (called "zippy") has header and content. Click on its header toggles the visibility of the content.
621
+
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.
622
622
623
623
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...
624
624
625
-
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.
625
+
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.
626
626
627
627
### Interpreter
628
628
629
629
>In computer programming, the interpreter pattern is a design pattern that specifies how to evaluate sentences in a language. The basic idea is to have a class for each symbol (terminal or nonterminal) in a specialized computer language. The syntax tree of a sentence in the language is an instance of the composite pattern and is used to evaluate (interpret) the sentence.
630
630
631
631

632
632
633
-
Inside its `$parse` service, AngularJS has its own interpreter of a DSL. The used DSL is simplified and modified version of JavaScript.
633
+
Behind its `$parse` service, AngularJS provides its own implementation of interpreter of a DSL (Domain Specific Language). The used DSL is simplified and modified version of JavaScript.
634
634
The main differences between the JavaScript expressions and AngularJS expressions that AngularJS expressions:
635
635
636
636
- may contain filters with UNIX like pipe syntax
@@ -649,6 +649,43 @@ var Parser;
649
649
650
650
Once given expression have been tokenized it is cached internally, because of performance concerns.
651
651
652
+
The terminal expressions in the AngularJS DSL are defined as follows:
0 commit comments