- update and move documentation to the wiki page.
- fix(AuthService): fix login URL.
- refactor(CollectionDirective).
Breaking changes:
WpEndpoint
is deprecated, use the name or the address of the endpoint directly, read more- In WpPost class the function
WpPost.featuredImageUrl(size)
is renamed toWpPost.featuredImage(size)
- update peerDependencies.
- rename npm package to
ngx-wordpress
.
- fix(ConfigService): check if photonOptions is defined, closes #27
- refactor(WordPressModule) initialize Photon options from
WordPressModule.forRoot(baseUrl, photonArgs(), debug)
- feat(PhotonService) exceptions
Breaking changes:
WpService.config.setPhotonQuery()
is removed, intializing photon is done fromWordPressModule
- feat(CollectionDirective) Collection directive
- feat(ModelDirective) Model directive
- docs(Readme): docs for version 3.x
- feat(ConfigService): Use
wpService.config.debug = true;
to log WP requests' URLs to console. - feat(build): Support systemjs
- refactor(gulp.js): improve build system
- WpQueryArgs removed, use an object instead
- DirectLink removed
- Components are replaced with directives
- ConfigService:
- requests' timeout removed
- loading notifier removed
- errors notifier removed
- (refactor) code is simplified
- Support AoT
- Import missing operators from rxjs
- Cleanup
- Demo folder
###Bugs:
- Fixes:
timeout
is not a function error, closes (#4)
- Fixes
WpHttp
: used to returnObservable.empty()
instead ofObservable.throw(err)
.
- ModelResponse interface for
WpService.Model()
responses. - Errors can be caught from the response for both
CollectionResponse
andModelResponse
withres.error
-
WpService.Model(): model response is now wrapped in ModelResponse object.
Before:
WpService.Model.(...).subscribe((res) => { this.data = res.data; }
After:
WpService.Model.(...).subscribe((res: ModelResponse) => { if(res.error){ console.log(res.error); } else{ this.data = res.data; } });
Use WpService.config
instead of WpConfig
to keep all usages in one service.
###Bugs:
-
Basic Authentication: Fixes request and return observable instead of void
WpService.auth().basic(username,password).subscribe(...)
-
WpService.Collection(): Added
next()
andprev()
functionscollectionService = wpService.collection().posts().get.subscribe(...)
Get collectioncollectionService.more().subscrube(...)
Combine current page with next page collectioncollectionService.next().subscrube(...)
Get next page collectioncollectionService.prev().subscrube(...)
Get prev page collection
-
WpCollectionComponent: Added
next()
andprev()
functions -
Discovery endpoint: Discover if a url has WP API install.
WpService.discover(url).subscribe(...)
-
Cookies Authentication:
WpService.auth().cookies().subscribe(...)
All helper classes has been prefixed with Wp
Post
is nowWpPost
User
is nowWpUser
QueryArgs
is nowWpQueryArgs
WpHelper.endpoint
is nowWpEndpoint
WpHelper
is deprecated.authentication
notifier is deprecated fromWpConfig
.
No changes.
- added keywords to
package.json
The service has been rewritten from scratch
- Before:
import {Collection} from 'ng2-wp-api/ng2-wp-api';
- After:
import {Collection} from 'ng2-wp-api';
- Collection response headers: fix property name for
X-WP-Total
andX-Wp-Totalpages