Posts

Showing posts with the label Git

RequireJS: More with templating - Dynamic data

Find the previous  episode here . Checkout the part 3 branch git checkout -b part4.0 origin/part4.0 Lets change the templating a bit different so that we could add data to the template. Now if we click on a link other than home everything will be gone. So we will move the link list to the index before maincontent so that it will always remain there. Next we will replace the modules/home/Home.html with some dummy text. The index.html wil looks like this <div>   <ul>     <li><a href="#home">Home</a></li>     <li><a href="#employee">Employees</a></li>     <li><a href="#project">Projects</a></li>   </ul> </div> <div id="maincontent">   </div> Next we will add some more dummy content to other template html file in projects and employees . And also change the controllers to load and how the content. And also we need to...

RequireJS: Getting Started

Modular programming helps to divide the application code based on the module. These programming style helps to manage as well develop the application easily. Requirejs is lightweight framework used in javascript to develop applications using the modular programming. RequireJS RequireJS is lightweight javascript framework which enables AMD(Asynchronous Module Loader). RequireJS helps to load javascript file and modules asynchronously. Apart from using in browser , it’s also be used alongside in Node projects. Why RequireJS? It’s lightweight, scalable, comes with an excellent optimising tool. Apart from these the use of  RequireJS comes handy when you need to divide and load javascript files and modules whenever they need. Suppose you had an application which have a home page, employees, and projects module. And had 3 javascript files like home.js, employees.js and projects.js. Normally in single page application you need to load these files when the page loads. L...

MEAN js Application structure

It's a continuation of previous post . Lets discuss about the application structure in a MEAN.js Application. Actually MEAN follows a MVC(Model-View-Controller). There are mainly two types of application structure for MVC. 1. Horizontal Folder Structure         This type of structure follows the division on functional role rather than the feature.The files and folders will kept inside a application folder .  There will be one controller folder for all application controllers. Horizontal structure is for simple projects where the features were limited. An example for this structure is app ----controllers ----models ----routes ----views config ----env ----strategies ----config.js ----express.js public ----config ----controllers ----directives ----css ----filters ----images ----views ----services server.js package.json app folder consists of all the express.io files or the server side files. app/controllers folder holds all express controller logic. a...

Getting Started with MEAN.js

Image
Recently am into Javscript development like node, angular etc. And i came across this awsome stack just like WAMP . It's called MEAN and am so much excited about this stack. MEAN stands for  Mongodb ]- The Database Express - The serverside framework Angular - The Client side MVC framework Node.js - the server or the server side runtime There are two major MEAN generators availbale , MEAN.js and MEAN.io . Both gives a kickstart  in MEAN development. But note than MEAN stack development is possible without these.  Both are theoratically same and uses same technologies and also developed by same guy, Amos Haviv . Am write down my "Getting started" experience with MEAN.js.  For MEAN.js you need these technologies installed. Node.js Git Mongodb After installing these , open a terminal and type: npm install -g grunt-cli Next Install bower npm install -g bower Next install yeomen generator npm install -g generator-meanjs ...