diff options
Diffstat (limited to 'docs/content/cookbook/mvc.ngdoc')
| -rw-r--r-- | docs/content/cookbook/mvc.ngdoc | 9 |
1 files changed, 0 insertions, 9 deletions
diff --git a/docs/content/cookbook/mvc.ngdoc b/docs/content/cookbook/mvc.ngdoc index 04feffcc..6a167469 100644 --- a/docs/content/cookbook/mvc.ngdoc +++ b/docs/content/cookbook/mvc.ngdoc @@ -3,19 +3,15 @@ @name Cookbook: MVC @description - MVC allows for a clean an testable separation between the behavior (controller) and the view (HTML template). A Controller is just a JavaScript class which is grafted onto the scope of the view. This makes it very easy for the controller and the view to share the model. - The model is simply the controller's this. This makes it very easy to test the controller in isolation since one can simply instantiate the controller and test without a view, because there is no connection between the controller and the view. - - <doc:example> <doc:source> <script> @@ -83,7 +79,6 @@ no connection between the controller and the view. }; </script> - <h3>Tic-Tac-Toe</h3> <div ng:controller="TicTacToeCntl"> Next Player: {{nextMove}} @@ -109,7 +104,6 @@ no connection between the controller and the view. expect(element('.winner').text()).toEqual('Player X has won!'); }); - function piece(row, col) { element('.board tr:nth-child('+row+') td:nth-child('+col+')').click(); } @@ -117,11 +111,8 @@ no connection between the controller and the view. </doc:example> - - # Things to notice - * The controller is defined in JavaScript and has no reference to the rendering logic. * The controller is instantiated by <angular/> and injected into the view. * The controller can be instantiated in isolation (without a view) and the code will still execute. |
