Git Product home page Git Product logo

basic_angular_app's Introduction

Basic angularJS app

An angularJS web app build using angularJS, Gulp & Bower

Demo / compiled app

Live Demo: http://webklex.github.io/basic_angular_app/dist/

Sourcecode Demo: https://github.com/Webklex/basic_angular_app/tree/gh-pages/dist

Requirements

  • nodejs
  • git

Setup

  • $ cd /path/to/repository
  • $ npm install
  • $ bower install
  • $ gulp

Development

Running the development version and do live edits is very simple. Just run "$ gulp serve". This will create a virtual webserver which can be used by entering http://localhost:8000. Any changes you do on your application willm be automaticly loaded in that web instance

  • $ gulp serve

Building & Production use

Building your app is very simple. Your application will be compiled in ./dist/* so all you have to do is copy all the content of ./dist to your www root. E.g.: /var/www/example.com/htdocs/

  • $ gulp build
  • $ cp -r ./dist/ /var/www/example.com/htdocs/

Included features

##Routing example All your routes are defined in ./src/app/router.js An example route is already defined.

when('/', {
    templateUrl: 'main.html',
    controller: 'mainController'
}).

Where the first passed parameter is the URL (in this case "/"), the following object passes the arguments.

otherwise({
    redirectTo: '/'
}).

This the the fallback URL. So any url missmatch will be redirected to "/". Further information about angular-routing ca be fount here.

##View management Any used view will be stored in ./src/app/views and are automaticaly compiled to a ng-template. If you need an example take a look at the ./src/app/router.js and the ./src/app/views/ folder content.

##Adding new bower compontents Adding a new bower components is fairly easy. Just install your component and run either gulp serve or gulp. The new compontent will be build and added to your application automaticaly.

##Adding custom styles and java scripts Please add all your custom css and js files which are not a angular controler or what so ever in the ./src/template/* folder. The files will be compiled into your application by gulp. So all you need to do is either run gulp or have gulp serve running.

#The magic ./scr/index.html This is your main file. Inside this file you can define your template. Such as navigation, footer and so on. Please note that the following components should be present at all time:

<!-- inject:css -->
<!-- endinject -->

<!-- inject:html -->
<!-- endinject -->

<!-- inject:js -->
<!-- endinject -->

So what does it do? Inject:css injects all required CSS files and inject:html includes all the html views converted into ng-templates. inject:js is required fo all javascript components. Besides these tags you can edit everything else inside the index.html file.

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.