Code Monkey home page Code Monkey logo

ngwp's Introduction

ngWP

Angular app that uses the WP Rest API plugin.

DEMO

Blog Post about building ngWP

Setup

Clone or download ngWP.

You will need node and gulp to setup ngWP. Once those are installed run npm install. From there you can run gulp bower to install all the front-end dependencies.

I have included several Gulp tasks to concat, minify, move, inject, and do all kinds of other things to the files. Here is the current workflow.

Once you have installed all the modules with npm install you should be ready to start development or whatever you want to do with the app. All you need to do is run gulp from the command line.

The gulp task runs the gulp watch task and will watch for any changes to the files within the js and sass directory.

So your first change should be to the Angular service that is doing GET requests to the WordPress website you have the REST API plugin installed on. Go to /js/services/posts-service.js and at the top of the file change the value of the url variable.

If you have the gulp task running, once you save the file all the gulp magic happens (check out the js task in gulpfile.js) and you should be able to see your posts.

Open another command line window and run gulp serve. This will setup a little web server so you can view your Angular app. Go to http://localhost:3000/ and you should be able to navigate through the different pages.

That's it!

Customization

For customization, basic knowledge of the command line and the following dependencies are required:

Gulp

gulp - automatically handles changes to files in the sass and js directories

gulp fonts - moves the Bootstrap font files from the bower directory into the root directory

gulp vendorjs - concatenate and minify certain javascript files from the bower directory

gulp vendorcss - concatenate and minify certain css files from the bower directory

gulp js - concatenate and minify the angular app javascript files

gulp sass - compile, prefix, and minify sass files

gulp serve - start a dev server

gulp bower - install bower components

gulp zip - creates a zipped file in the root directory. Ignores the bower_components and node_modules directories.

ngwp's People

Contributors

braginteractive avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ngwp's Issues

Unable to load correct single post

Thank you for creating this project. It's been fascinating to learn from.

I've run into a small problem with the single post view. When I use the content from the project's demo at http://braginteractive.com/demo/wp-json/wp/v2/ the single view of the posts load correctly. However I've been unable to get the correct single post view to load from other sources. The most recently published post is the one that displays regardless of which post in the list is clicked. I've used both sites that I manage and other ones like WP Tavern (https://wptavern.com/wp-json/wp/v2/).

Any thoughts on what might be up there? Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.