aboutsummaryrefslogtreecommitdiffstats
path: root/docs/content/guide/dev_guide.mvc.understanding_model.ngdoc
diff options
context:
space:
mode:
authorTobias Bosch2013-11-05 22:16:11 -0800
committerTobias Bosch2013-11-06 17:11:44 -0800
commitfc060dfc08f048511fe78e9df04ce4616171da34 (patch)
tree71b912fb07c70b3e5c315577057b13c85b2032e6 /docs/content/guide/dev_guide.mvc.understanding_model.ngdoc
parent947a44d1ee6b253a5f31bb28616e0fa0303bd4aa (diff)
downloadangular.js-fc060dfc08f048511fe78e9df04ce4616171da34.tar.bz2
docs(guide/overview): Refactor overview and mvc docs
Before, there we multiple overview docs: - guide/overview - guide/introduction - guide/dev_guide.mvc - guide/dev_guide.mvc.understanding_model - guide/dev_guide.mvc.understanding_view - guide/concepts Now we have: - guide/introduction: High level description of Angular with the key benefits but without code or any concrete concepts - guide/concepts: explains all important concepts with a simple example and contains deep links to the other parts of the guide. All the old information was moved into existing documents or deleted when they were duplicates.
Diffstat (limited to 'docs/content/guide/dev_guide.mvc.understanding_model.ngdoc')
-rw-r--r--docs/content/guide/dev_guide.mvc.understanding_model.ngdoc71
1 files changed, 0 insertions, 71 deletions
diff --git a/docs/content/guide/dev_guide.mvc.understanding_model.ngdoc b/docs/content/guide/dev_guide.mvc.understanding_model.ngdoc
deleted file mode 100644
index 1f4715c1..00000000
--- a/docs/content/guide/dev_guide.mvc.understanding_model.ngdoc
+++ /dev/null
@@ -1,71 +0,0 @@
-@ngdoc overview
-@name Developer Guide: About MVC in Angular: Understanding the Model Component
-@description
-
-Depending on the context of the discussion in the Angular documentation, the term _model_ can refer to
-either a single object representing one entity (for example, a model called "phones" with its value
-being an array of phones) or the entire data model for the application (all entities).
-
-In Angular, a model is any data that is reachable as a property of an angular {@link
-scope Scope} object. The name of the property is the model identifier and the value is
-any JavaScript object (including arrays and primitives).
-
-The only requirement for a JavaScript object to be a model in Angular is that the object must be
-referenced by an Angular scope as a property of that scope object. This property reference can be
-created explicitly or implicitly.
-
-You can create models by explicitly creating scope properties referencing JavaScript objects in the
-following ways:
-
-* Make a direct property assignment to the scope object in JavaScript code; this most commonly
-occurs in controllers:
-
- function MyCtrl($scope) {
- // create property 'foo' on the MyCtrl's scope
- // and assign it an initial value 'bar'
- $scope.foo = 'bar';
- }
-
-* Use an {@link expression angular expression} with an assignment operator in templates:
-
- <button ng-click="{{foo='bar'}}">Click me</button>
-
-* Use {@link api/ng.directive:ngInit ngInit directive} in templates (for toy/example apps
-only, not recommended for real applications):
-
- <body ng-init=" foo = 'bar' ">
-
-Angular creates models implicitly (by creating a scope property and assigning it a suitable value)
-when processing the following template constructs:
-
-* Form input, select, textarea and other form elements:
-
- <input ng-model="query" value="fluffy cloud">
-
- The code above creates a model called "query" on the current scope with the value set to "fluffy
-cloud".
-
-* An iterator declaration in {@link api/ng.directive:ngRepeat ngRepeater}:
-
- <p ng-repeat="phone in phones"></p>
-
- The code above creates one child scope for each item in the "phones" array and creates a "phone"
-object (model) on each of these scopes with its value set to the value of "phone" in the array.
-
-In Angular, a JavaScript object stops being a model when:
-
-* No Angular scope contains a property that references the object.
-
-* All Angular scopes that contain a property referencing the object become stale and eligible for
-garbage collection.
-
-The following illustration shows a simple data model created implicitly from a simple template:
-
-<img src="img/guide/about_model_final.png">
-
-
-## Related Topics
-
-* {@link dev_guide.mvc About MVC in Angular}
-* {@link dev_guide.mvc.understanding_controller Understanding the Controller Component}
-* {@link dev_guide.mvc.understanding_view Understanding the View Component}