@@ -721,9 +721,9 @@ function isLeafNode (node) {
721
721
* @returns {* } The copy or updated `destination`, if `destination` was specified.
722
722
*
723
723
* @example
724
- <example>
724
+ <example module="copyExample" >
725
725
<file name="index.html">
726
- <div ng-controller="Controller ">
726
+ <div ng-controller="ExampleController ">
727
727
<form novalidate class="simple-form">
728
728
Name: <input type="text" ng-model="user.name" /><br />
729
729
E-mail: <input type="email" ng-model="user.email" /><br />
@@ -737,21 +737,22 @@ function isLeafNode (node) {
737
737
</div>
738
738
739
739
<script>
740
- function Controller($scope) {
741
- $scope.master= {};
740
+ angular.module('copyExample')
741
+ .controller('ExampleController', ['$scope', function($scope) {
742
+ $scope.master= {};
742
743
743
- $scope.update = function(user) {
744
- // Example with 1 argument
745
- $scope.master= angular.copy(user);
746
- };
744
+ $scope.update = function(user) {
745
+ // Example with 1 argument
746
+ $scope.master= angular.copy(user);
747
+ };
747
748
748
- $scope.reset = function() {
749
- // Example with 2 arguments
750
- angular.copy($scope.master, $scope.user);
751
- };
749
+ $scope.reset = function() {
750
+ // Example with 2 arguments
751
+ angular.copy($scope.master, $scope.user);
752
+ };
752
753
753
- $scope.reset();
754
- }
754
+ $scope.reset();
755
+ }]);
755
756
</script>
756
757
</file>
757
758
</example>
0 commit comments