Showing posts with label ngx-wordpress. Show all posts
Showing posts with label ngx-wordpress. Show all posts
<img src="https://camo.githubusercontent.com/fc2124e30dcb85d7a66a8dccb8ffd295012710b0/68747470733a2f2f63646e2e7261776769742e636f6d2f4d7572686166536f75736c692f6e67782d776f726470726573732f316238636563306130343132656230393835343566646233646635653835643832346534343038622f6173736574732f6c6f676f2e737667" height="150" width="150"></img> <br> ngx-wordpress


ngx-wordpress

October 29, 2017
This library is designed to make it easy for your Angular application to request specific resources from a WordPress install.
  • :electric_plug: WordPress Rest API WordPressModule.forRoot(WordPressDomain)
  • :european_castle: WordPress RX Service
    • Get post wpService.collection().posts().get(postQueryArgs).subscribe(res => posts = res.data)
    • Add new post wpService.collection().posts().add(newPost).subscribe(res => newPost = res.data )
    • Get post by Id wpService.model().posts().get(postId).subscribe(res => post = res.data)
    • Update page wpService.model().pages().add(pageId, page).subscribe(res => page = res.data )
    • Delete post wpService.model().posts().delete(postId).subscribe(res => res)
  • 🤹‍ Wordpress Directives

     <!--  Get collection of posts  -->  
     <ul [wpCollection]="'posts'" [wpArgs]="postQueryArgs" (wpResponse)="posts = $event">  
      <li *ngFor="let post of res.data"> {{ post.title.rendered }} </li>  
     </ul>  
     <!--  Get post by ID  -->  
     <div [wpModel]="'pages'" [wpId]="123" [wpResponse]="res = $event"> {{res?.data.title.rendered}} </div>  
       :vertical_traffic_light:  
    

  • :vertical_traffic_light: Authentication
    • :old_key: Basic authentication wpService.auth().basic(username, password, remember?)
    • :cookie: Cookies authentication wpService.auth().cookies()
  • :icecream: Helper functions to access data in post responses
  • Photon CDN
  • :hammer_and_wrench: Blog assests:

Wiki Documentation


Note: Special thanks to Murhaf Sousli
Contact: murhafsousli@gmail.com
Disclaimer: The blog is created to share angular directives information to geek, curious Angular Developers.