1.0.8 • Published 7 years ago

frontpress v1.0.8

Weekly downloads
1
License
MIT
Repository
github
Last release
7 years ago

frontpress-logo-horizontal

A full front-end AngularJS template for WordPress Rest API.

-

Build Status Codacy Badge Join the chat at https://gitter.im/teles/frontpress npm.io Github Issues dependencies Status devDependencies Status

https://nodei.co/npm/frontpress.png?downloads=true&downloadRank=true&stars=true

Getting Started

Install FrontPress using NPM:

npm install frontpress --save
  • Import angular and frontpress to your project.
<script type="text/javascript" src="/node_modules/angular/angular.min.js"></script>
<script type="text/javascript" src="/node_modules/frontpress/release/frontpress.min.js"></script>

Install FrontPress using Bower:

bower install frontpress --save
  • Import angular and frontpress to your project.

:warning: remember to install angular 1.x.

<script type="text/javascript" src="/bower_components/angular/angular.min.js"></script>
<script type="text/javascript" src="/bower_components/frontpress/release/frontpress.min.js"></script>

Configure your project to use FrontPress

  • Add frontpress to your required modules list:
angular.module('myBlog', ['frontpress']);
  • Configure your module using $FrontPressProvider !
angular.module('myBlog').config(function($FrontPressProvider){

	$FrontPressProvider.configure.load({
		"restApiUrl": "https://demo.wp-api.org/wp-json",
		"apiVersion": "v2",
		"pageSize": 5,
		"infiniteScroll": true,
		"routes": {
			"post": "/:postYear/:postMonth/:postDay/:postSlug",
			"home.pagination": "/page/:pageNumber"
		},
		"titles": {
			"post": ":postTitle - :siteName",
			"home": "Home - :siteName"
		},
		"overrides": {
			"siteName": "My Awesome SPA Blog"
		}
	});
	
});

It's done!

Further relevant informations

License

MIT © Teles

1.0.8

7 years ago

1.0.7

7 years ago

1.0.6

7 years ago

1.0.5

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago