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 Active Record object is an object, which carries both data and behavior. Usually most of the data in these objects is persistent, responsibility of the Active Record object is to take care of the communication with the database in order to create, update, retrieve or delete the data. It may delegate this responsibility to lower level objects but calls to instance or static methods of the active record object cause the database communication.
AngularJS defines a service called `$resource`. In the current version of AngularJS(1.2+) it is being distributed in module outside of the AngularJS' core.
@@ -566,23 +566,23 @@ var User = $resource('/users/:id'),
566
566
user.$save();
567
567
```
568
568
569
-
The call of `$resource`will create a constructor function for our model instances. Each of the model instances will have methods, which could be used for the different CRUD operations.
This way we can use the constructor function and its static methods by:
571
+
このように、コンストラクタ関数と静的メソッドを使います:
572
572
573
573
```JavaScript
574
574
User.get({ userid: userid });
575
575
```
576
576
577
-
The code above will immediately return an empty object and keep reference to it. Once the response have been successfully returned and parsed, AngularJS will populate this object with the received data (see [proxy](#proxy)).
You can find more details for `$resource`[The magic of $resource](http://blog.mgechev.com/2014/02/05/angularjs-resource-active-record-http/)and[AngularJS' documentation](https://docs.angularjs.org/api/ngResource/service/$resource).
579
+
`$resource`についての詳細は、 [The magic of $resource](http://blog.mgechev.com/2014/02/05/angularjs-resource-active-record-http/)や[AngularJS' documentation](https://docs.angularjs.org/api/ngResource/service/$resource) で確認できます。
580
580
581
-
Since Martin Fowler states that
581
+
Martin Fowlerがこのように宣言しているように:
582
582
583
-
> responsibility of the Active Record object is to take care of the communication with the databse in order to create...
`$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".
0 commit comments