From e28368e99744d9c24eac708905ff156b37b2b067 Mon Sep 17 00:00:00 2001 From: Ignacio Baixas Date: Wed, 24 Sep 2014 12:04:29 -0300 Subject: [PATCH] feat(docs): improves mixin related docs --- docs/index.md | 16 ++++++++-------- src/plugins/find-many.js | 8 ++++---- src/plugins/preload.js | 2 ++ 3 files changed, 14 insertions(+), 12 deletions(-) diff --git a/docs/index.md b/docs/index.md index c25d57c..90e330b 100644 --- a/docs/index.md +++ b/docs/index.md @@ -7,11 +7,11 @@ For a quick usage reference checkout the [README](https://github.com/platanus/an ## Main Components -### The **$restmod** service +### The **restmod** service -The main entry point for the library is the [$restmod service]($restmod.html). This service provides the `model` factory method that allow creation of new models via the builder DSL. +The main entry point for the library is the [restmod service](restmod.html). This service provides the `model` factory method that allow creation of new models via the builder DSL. -There is also a [restmod provider]($restmodProvider.html) that allows some global configuration of models. +There is also a [restmod provider](restmodProvider.html) that allows some global configuration of models. ### The Model Builder API @@ -21,7 +21,7 @@ An extensive description of the builder usage and options can be found in the [B ### The Model Type -Every call to `$restmod.model` generates a new model type. +Every call to `restmod.model` generates a new model type. Every instance of the model is called a record, every record has its own set of instance methods, check the [RecordApi](RecordApi.html) section for reference. @@ -42,8 +42,8 @@ The restmod lib includes a couple of mixins that can be included in the project * [PagedModel](PagedModel.html): basic paging support, included in **plugins/paged.js**. (very basic) * [DirtyModel](DirtyModel.html): change tracking for record properties, included in **plugins/dirty.js**. * [DebouncedModel](DebouncedModel.html): provides a debounced/throttled implementation of $save, included in **plugins/debounced.js**. (DEPRECATED: To be moved to a separate library!) -* [DebouncedModel](DebouncedModel.html): provides a debounced/throttled implementation of $save, included in **plugins/debounced.js**. (DEPRECATED: To be moved to a separate library!) -* [DebouncedModel](DebouncedModel.html): provides a debounced/throttled implementation of $save, included in **plugins/debounced.js**. (DEPRECATED: To be moved to a separate library!) - +* [Shared](SharedModel.html): shared record instances, included in **plugins/shared.js**. +* [FindMany](FindMany.html): batch find by id using the `$populate` method, included in **plugins/find-many.js**. +* [Preload](Preload.html): reference relation eager loading via the `$preload` method, included in **plugins/preload.js**. -Check the [$restmod service]($restmod.html) docs for more information about mixin creation. +Check the [restmod service](restmod.html) docs for more information about mixin creation. diff --git a/src/plugins/find-many.js b/src/plugins/find-many.js index 14ada1a..91649db 100644 --- a/src/plugins/find-many.js +++ b/src/plugins/find-many.js @@ -1,5 +1,5 @@ /** - * @mixin Populate + * @mixin FindMany * * @description * @@ -15,8 +15,8 @@ angular.module('restmod').factory('restmod.FindMany', ['restmod', 'RMPackerCache return restmod.mixin(function() { /** - * @method $populate - * @memberOf Populate + * @method $findManyUrl + * @memberOf FindMany * * @description Provides the url for a findMany/populate operation. */ @@ -25,7 +25,7 @@ angular.module('restmod').factory('restmod.FindMany', ['restmod', 'RMPackerCache }) /** * @method $populate - * @memberOf Populate + * @memberOf FindMany * * @description Resolves a series of records using a single api call. * diff --git a/src/plugins/preload.js b/src/plugins/preload.js index 2aad372..22ed62c 100644 --- a/src/plugins/preload.js +++ b/src/plugins/preload.js @@ -66,6 +66,8 @@ angular.module('restmod').factory('restmod.Preload', ['restmod', '$q', function( * handles nested relation names. If a nested relation is added to be resolved * then the parent relation is also resolved. * + * **IMPORTANT**: Only `belongsTo` and `belongsToMany` relations can be preloaded. + * * Usage: * * ```javascript