Coder Social home page Coder Social logo

gilbertobotaro / angularjs-boilerplate Goto Github PK

View Code? Open in Web Editor NEW

This project forked from shelob9/wp-js-spa-admin-boilerplate

0.0 1.0 0.0 197 KB

This is a JavaScript Single Page App built into a WordPress Admin Page - using AngularJS

License: GNU General Public License v3.0

PHP 46.99% JavaScript 20.63% CSS 15.42% HTML 16.97%

angularjs-boilerplate's Introduction

#WordPress Admin JavaScript Single Page Application Boilerplate My intention or this project is to be an easy starting point for anyone wanting to create a WordPress admin that is a JavaScript SPA. Right now this is a standalone WordPress plugin.

##AngularJS This repo is the AngularJS version of the boilerplate, check out the organization for other versions

##Installation

  • Clone Repo into wp-content/plugins
  • Run npm install
  • Run gulp

##Starter Content I have included a CPT of 'Book' to get created with 10 posts, to turn this off comment out lines 64-65 of admin-js-app.php

##CPT REST Support Add support for your existing CPT's by adding the slug to line 49 in admin-js-app.php code Once added, your CPT will now automatically have REST support via /wp-json/wp/v2/[cpt-slug]

##Custom API Endpoints In includes/admin_custom_api.php you will find the custom api endpoints I have created, I have kept it simple so you can modify or copy to create your own

##Custom API Fields Since my example just uses a basic CPT, it is easier just to create custom rest fields for the post meta you want to get/save. api_field code

Please add new api_fields (one per meta field if possible) as you need them. You will need to create both a function to return the meta on GET and update on POST requests.

##Routes & Templates All html templates are located in templates/ Default routes include:

  • / main page - admin-js-app-main.html
  • /books listing page - admin-js-app-list.html
  • /book/:id detail page - admin-js-app-detail.html
  • /book/:id/edit edit page - admin-js-app-edit.html

angularjs-boilerplate's People

Contributors

royboy789 avatar aitzkovitz avatar

Watchers

Gilberto Botaro avatar

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.