Skip to content

Commit

Permalink
v1.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
braginteractive committed Dec 16, 2015
1 parent ea1356d commit e629fb0
Show file tree
Hide file tree
Showing 41 changed files with 1,551 additions and 67 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.DS_Store
*.log
node_modules
bower_components
14 changes: 0 additions & 14 deletions LICENSE.txt

This file was deleted.

61 changes: 58 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,61 @@
ng-modules
ngWP
==========

Demonstration of using Angular with simple Gulp concatenation.
Angular app that uses the WP Rest API plugin.


#### 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:

- Angular ([https://angularjs.org/](https://angularjs.org/))
- Node ([http://nodejs.org/](http://nodejs.org/)) -`npm install`
- Gulp ([http://gulpjs.com/](http://gulpjs.com/)) - `npm install --global gulp`
- Bower ([http://bower.io/](http://bower.io/)) -`npm install -g bower`


#### 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.







https://medium.com/@dickeyxxx/best-practices-for-building-angular-js-apps-266c1a4a6917
4 changes: 2 additions & 2 deletions app.js
100755 → 100644

Large diffs are not rendered by default.

24 changes: 24 additions & 0 deletions bower.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"name": "ngWP",
"description": "",
"main": "",
"license": "MIT",
"moduleType": [],
"ignore": [
"**/.*",
"node_modules",
"bower_components",
"test",
"tests"
],
"devDependencies": {
"angular-ui-router-title": "~0.0.4",
"angular-loading-bar": "~0.8.0",
"angular": "~1.4.8",
"angular-bootstrap": "~0.14.3",
"bootstrap": "~3.3.6",
"angular-animate": "~1.4.8",
"angular-ui-router": "~0.2.15",
"angular-sanitize": "~1.4.8"
}
}
51 changes: 51 additions & 0 deletions css/style.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions css/style.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions dist/vendor.css

Large diffs are not rendered by default.

Loading

0 comments on commit e629fb0

Please sign in to comment.