<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-8625939250791601558</id><updated>2026-11-10T14:07:06.841+05:30</updated><category term="all"/><category term="html"/><category term="css3"/><category term="javascript"/><category term="css"/><category term="jquery"/><category term="tricks"/><category term="html5"/><category term="Angular.js"/><category term="info"/><category term="scss"/><category term="bootstrap"/><category term="Node.js"/><category term="fontawesome"/><category term="material design"/><category term="MongoDB"/><category term="blogging"/><category term="Backbone.js"/><category term="Cordova. Android"/><category term="Ember.js"/><category term="Express.js"/><category term="Hybrid App"/><category term="Socket.IO"/><category term="angular 2"/><category term="asp.net"/><category term="bower"/><category term="ionic"/><category term="loader"/><category term="mongoose"/><category term="npm"/><category term="sass"/><category term="tlt"/><category term="xml"/><title type='text'>T E C H I E | JavaScript, HTML5, CSS3</title><subtitle type='html'>A responsive blog/website for my research, development and experimental works. Here i code and add technical posts which interests me. I enjoy JavaScript coding. NodeJS, BackboneJS, RespondJS are my major preferences. </subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://thelittletechie.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8625939250791601558/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://thelittletechie.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/8625939250791601558/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>164</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-8625939250791601558.post-2856257630052027170</id><published>2017-09-23T16:22:00.000+05:30</published><updated>2017-09-23T16:22:25.242+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="all"/><category scheme="http://www.blogger.com/atom/ns#" term="info"/><category scheme="http://www.blogger.com/atom/ns#" term="npm"/><title type='text'>npm unset a registry</title><content type='html'>&lt;div class=&quot;tltpost&quot;&gt;

&lt;div class=&quot;tltimg&quot;&gt;
&lt;a href=&quot;/2017/09/npm-unset-registry.html#tlt&quot;&gt;&lt;img src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEijDc1iyxPMOEfSbAkWTgoJg0I6ZQJBrfgae8AYpbd-WI-w2DoXfcfZjKiPIFUFQQnxW-JHJuCuiwNidR3vdtqGnopPT5z7EhvY2jPjdNA_7ohxj05ko0LQBGASqYx4ARa5rczR5WJ6DPY/s1600/npm-unset-a-registry.jpg&quot; title=&quot;npm unset a registry&quot; alt=&quot;npm unset a registry&quot; /&gt;&lt;/a&gt;
&lt;/div&gt;

&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;

&lt;p&gt;A registry is set using below command,&lt;/p&gt;

&lt;pre&gt;
npm set registry http://www.thelittletechie.com:8080
&lt;/pre&gt;

&lt;p&gt;To unset a registry type the below command in command prompt.&lt;/p&gt;

&lt;pre&gt;
npm config edit
&lt;/pre&gt;

&lt;p&gt;This opens a file in editor with the file name .npmrc which is the config file of npm.&lt;/p&gt;
&lt;p&gt;Remove the registry line which you have set and save the file.&lt;/p&gt;
&lt;pre&gt;
registry=http://www.thelittletechie.com:8080/
&lt;/pre&gt;

&lt;p&gt;Thats it you have now removed the set registry.&lt;/p&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://thelittletechie.blogspot.com/feeds/2856257630052027170/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://thelittletechie.blogspot.com/2017/09/npm-unset-registry.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8625939250791601558/posts/default/2856257630052027170'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8625939250791601558/posts/default/2856257630052027170'/><link rel='alternate' type='text/html' href='http://thelittletechie.blogspot.com/2017/09/npm-unset-registry.html' title='npm unset a registry'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEijDc1iyxPMOEfSbAkWTgoJg0I6ZQJBrfgae8AYpbd-WI-w2DoXfcfZjKiPIFUFQQnxW-JHJuCuiwNidR3vdtqGnopPT5z7EhvY2jPjdNA_7ohxj05ko0LQBGASqYx4ARa5rczR5WJ6DPY/s72-c/npm-unset-a-registry.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8625939250791601558.post-6473312818603083625</id><published>2017-08-03T22:10:00.002+05:30</published><updated>2017-08-06T12:23:21.057+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="all"/><category scheme="http://www.blogger.com/atom/ns#" term="angular 2"/><title type='text'>Model Driven Forms in Angular 2</title><content type='html'>&lt;div class=&quot;tltpost&quot;&gt;
&lt;div class=&quot;tltimg&quot;&gt;
&lt;a href=&quot;http://blog.thelittletechie.com/2017/08/model-driven-forms-in-angular-2.html#tlt&quot;&gt;&lt;img src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgenmZj4wfNzAKePkvjiG6mxRZ3KtmWIVxgCyNciyBPpAYRjVUw0HeMsyD5M_bB68XQ-8cgJ-jgyBoazbktx4TxIKMFo0Gk2grYPym5KtU1M82X3fIaIeTCfRyscFO00NHxoGpyfuhXkaI/s1600/Model-Driven-Forms-in-Angular-2.jpg&quot; title=&quot;Model Driven Forms in Angular 2&quot; alt=&quot;Model Driven Forms in Angular 2&quot; /&gt;&lt;/a&gt;
&lt;/div&gt;

&lt;p&gt;Creating a nested model driven form in angular 2 is very simple. You want to create a form for it that allows a user to add a new fields(input, text-area, select etc.) dynamically.&lt;/p&gt;

&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;
&lt;p&gt;Before starting with it let me explain difference between a template driven form and a model driven form.&lt;/p&gt;

&lt;h4 class=&quot;default-header tltheader&quot;&gt; Difference between template driven and model driven form&lt;/h4&gt;
&lt;p&gt;In template driven form we write our logic, validation everything in template itself (i.e html file). Whereas in model driven form all the login, validation are written in the controller side (i.e typescript file).&lt;/p&gt;

&lt;p&gt;I will explain you this by creating details of a customer.&lt;/p&gt;

&lt;h4 class=&quot;default-header tltheader&quot;&gt; Folder structure&lt;/h4&gt;
&lt;pre&gt;
--app
-----app.component.ts
-----app.module.ts
-----app.template.html
-----address.component.ts
-----address.template.html
-----phone.component.ts
-----phone.template.html
-----phone-mask.directive.ts
-----customer.interface.ts
-----main.ts
--index.html
--systemjs.config
--tsconfig.json
&lt;/pre&gt;

&lt;p&gt;We will build a form to capture information of the user based on the interface below.&lt;/p&gt;
&lt;h4 class=&quot;code-header tltheader&quot;&gt; customer.interface.ts&lt;/h4&gt;
&lt;pre&gt;
export interface Customer {
    name: string;
    addresses: Address[];
    phones: Phone[];
}

export interface Address {
    street: string;
    postcode: string;
}

export interface Phone {
    phone: string;
    phoneType: string;
}
&lt;/pre&gt;
&lt;p&gt;Here the address and phone fields are going to be dynamic. You can add more number of fields as you want.&lt;/p&gt;

&lt;p&gt;Here&#39;s the module of our application.&lt;/p&gt;
&lt;h4 class=&quot;code-header tltheader&quot;&gt; app.module.ts&lt;/h4&gt;
&lt;pre&gt;
import { NgModule }      from &#39;@angular/core&#39;;
import { BrowserModule } from &#39;@angular/platform-browser&#39;;
import { FormsModule, ReactiveFormsModule } from &#39;@angular/forms&#39;;

import { AppComponent }   from &#39;./app.component&#39;;
import { AddressComponent } from &#39;./address.component&#39;;
import { PhoneComponent } from &#39;./phone.component&#39;;
import { PhoneMaskDirective } from &#39;./phone-mask.directive&#39;;

@NgModule({
    imports:      [ BrowserModule, ReactiveFormsModule ],
    declarations: [ AppComponent, AddressComponent, PhoneComponent, PhoneMaskDirective ],
    bootstrap:    [ AppComponent ]
})

export class AppModule { }
&lt;/pre&gt;

&lt;p&gt;Let&#39;s move on to create our app component.&lt;/p&gt;
&lt;h4 class=&quot;code-header tltheader&quot;&gt; app.component.ts&lt;/h4&gt;
&lt;pre&gt;
import { Component, OnInit } from &#39;@angular/core&#39;;
import { FormGroup, FormArray, FormBuilder, Validators } from &#39;@angular/forms&#39;;
import { Customer } from &#39;./customer.interface&#39;;

@Component({
    moduleId: module.id,
    selector: &#39;my-app&#39;,
    templateUrl: &#39;app.template.html&#39;,
})
export class AppComponent implements OnInit {
    public myForm: FormGroup;

    constructor(private _fb: FormBuilder) { }
    
    ngOnInit() {
    // we will initialize our form here
    }

    save(model: Customer) {
        // call API to save customer
        console.log(model);
    }
}
&lt;/pre&gt;

&lt;h4 class=&quot;default-header tltheader&quot;&gt; Implementation&lt;/h4&gt;
&lt;p&gt;All set! Let&#39;s implement our model-driven form.&lt;/p&gt;

&lt;h4 class=&quot;default-header tltheader&quot;&gt; Initialize the Form Model&lt;/h4&gt;
&lt;p&gt;Now, let&#39;s initialize our form model and create the functions that allow us to add and remove an address and phone number fields.&lt;/p&gt;
&lt;p&gt;Here is the shortest way to define a form:&lt;/p&gt;
&lt;pre&gt;
ngOnInit() {
    this.myForm = this._fb.group({
        name: [&#39;&#39;, [Validators.required, Validators.minLength(5)]],
        addresses: this._fb.array([]),
        phones: this._fb.array([])
    });
 
    // add address
    this.addAddress();
 
    let pArr = [
        {phone: &quot;(502) 555-1234&quot;, phoneType: &quot;sms&quot;}, 
        {phone: &quot;(502) 555-1111&quot;, phoneType: &quot;home&quot;}, 
        {phone: &quot;(502) 555-9876&quot;, phoneType: &quot;tty&quot;}
    ];
    pArr.forEach(p =&gt; this.addPhone(p));
}
&lt;/pre&gt;

&lt;p&gt;Lets create a form using angular form.&lt;/p&gt;
&lt;pre&gt;
&amp;lt;form [formGroup]=&amp;quot;myForm&amp;quot; novalidate (ngSubmit)=&amp;quot;save(myForm)&amp;quot;&amp;gt;
    &amp;lt;!-- we will place our fields here --&amp;gt;
    &amp;lt;button type=&quot;submit&quot;&amp;gt;Submit&amp;lt;/button&amp;gt;
&amp;lt;/form&amp;gt;
&lt;/pre&gt;

&lt;p&gt;A form is a type of FormGroup. A FormGroup can contain one FormGroup or FormControl. In our case, myForm is a FormGroup. There are 3 functions available in the form builder:&lt;/p&gt;
&lt;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;group:&lt;/strong&gt; construct a new form group. E.g. our myForm, address model, phone model.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;array:&lt;/strong&gt; construct a new form array. E.g. our customer&#39;s list of addresses and phones.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;control:&lt;/strong&gt; construct a new form control.&lt;/li&gt;
&lt;/ul&gt;
&lt;/p&gt;
&lt;p&gt;Each form control accepts an array. The first parameter is the default value of the control, the second parameter accepts either a validator or an array of validators, and the third parameter is the async validator.&lt;/p&gt;

&lt;p&gt;Address and phone fields are going to be as form array as these fields are going to be dynamic, user can create any number of these fields by clicking on the add button.&lt;/p&gt;
&lt;pre&gt;
&amp;lt;!--addresses--&amp;gt;
&amp;lt;div formArrayName=&amp;quot;addresses&amp;quot;&amp;gt;
    &amp;lt;div *ngFor=&amp;quot;let address of myForm.controls.addresses.controls; let i=index&amp;quot; class=&amp;quot;panel panel-default&amp;quot;&amp;gt;
        &amp;lt;div [formGroupName]=&amp;quot;i&amp;quot;&amp;gt;
            &amp;lt;address [group]=&amp;quot;myForm.controls.addresses.controls[i]&amp;quot;&amp;gt;&amp;lt;/address&amp;gt;
        &amp;lt;/div&amp;gt;
    &amp;lt;/div&amp;gt;
&amp;lt;/div&amp;gt;
&amp;lt;div&amp;gt;
    &amp;lt;a (click)=&amp;quot;addAddress()&amp;quot;&amp;gt;
        Add another address +
    &amp;lt;/a&amp;gt;
&amp;lt;/div&amp;gt;

&amp;lt;!-- phones --&amp;gt;
&amp;lt;div formArrayName=&amp;quot;phones&amp;quot;&amp;gt;
    &amp;lt;div *ngFor=&amp;quot;let phone of myForm.controls.phones.controls; let i = index&amp;quot; class=&amp;quot;panel panel-default&amp;quot;&amp;gt;
        &amp;lt;div [formGroupName]=&amp;quot;i&amp;quot;&amp;gt;
            &amp;lt;phone [group]=&amp;quot;myForm.controls.phones.controls[i]&amp;quot;&amp;gt;&amp;lt;/phone&amp;gt;
        &amp;lt;/div&amp;gt;
    &amp;lt;/div&amp;gt;
&amp;lt;/div&amp;gt;
&amp;lt;div&amp;gt;
    &amp;lt;a (click)=&amp;quot;addPhone()&amp;quot;&amp;gt;
        Add another phone number +
    &amp;lt;/a&amp;gt;
&amp;lt;/div&amp;gt;
&lt;/pre&gt;

&lt;p&gt;A few notes here:&lt;/p&gt;
&lt;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;formControlName&lt;/code&gt; directive: the form control name.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;formArrayName&lt;/code&gt; directive: the array name. In our example, we bind addresses and phones to the formArrayName.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;formGroupName&lt;/code&gt; directive: the form group name. Since addresses and phones is an array, Angular assigns the index number as the group name to each of the addresess and phones. Therefore, we&#39;ll bind the index i, to formGroupName.&lt;/li&gt;
&lt;/ul&gt;
&lt;/p&gt;

&lt;p&gt;Our form is working fine now. But imagine that you have a huge form which consists of a lot of controls, we might need to consider moving each group of controls to a separate component to keep our code neat.&lt;/p&gt;
&lt;p&gt;Let&#39;s move our address and phone implementation to a new component.&lt;/p&gt;
&lt;h4 class=&quot;code-header tltheader&quot;&gt; address.component.ts&lt;/h4&gt;
&lt;pre&gt;
import { Component, Input } from &#39;@angular/core&#39;;
import { FormGroup } from &#39;@angular/forms&#39;;

@Component({
    moduleId: module.id,
    selector: &#39;address&#39;,
    templateUrl: &#39;address.template.html&#39;,
})
export class AddressComponent {
    @Input(&#39;group&#39;)
    public adressForm: FormGroup;
}
&lt;/pre&gt;
&lt;h4 class=&quot;code-header tltheader&quot;&gt; address.template.html&lt;/h4&gt;
&lt;pre&gt;
&amp;lt;div [formGroup]=&amp;quot;adressForm&amp;quot;&amp;gt;
    &amp;lt;div class=&amp;quot;form-group col-xs-6&amp;quot;&amp;gt;
        &amp;lt;label&amp;gt;street&amp;lt;/label&amp;gt;
        &amp;lt;input type=&amp;quot;text&amp;quot; class=&amp;quot;form-control&amp;quot; formControlName=&amp;quot;street&amp;quot;&amp;gt;
    &amp;lt;/div&amp;gt;
    &amp;lt;div class=&amp;quot;form-group col-xs-6&amp;quot;&amp;gt;
        &amp;lt;label&amp;gt;postcode&amp;lt;/label&amp;gt;
        &amp;lt;input type=&amp;quot;text&amp;quot; class=&amp;quot;form-control&amp;quot; formControlName=&amp;quot;postcode&amp;quot;&amp;gt;
    &amp;lt;/div&amp;gt;
&amp;lt;/div&amp;gt;
&lt;/pre&gt;

&lt;h4 class=&quot;code-header tltheader&quot;&gt; phone.component.ts&lt;/h4&gt;
&lt;pre&gt;
import { Component, Input } from &#39;@angular/core&#39;;
import { FormGroup } from &#39;@angular/forms&#39;;

@Component({
    moduleId: module.id,
    selector: &#39;phone&#39;,
    templateUrl: &#39;phone.template.html&#39;
})
export class PhoneComponent {
    @Input(&#39;group&#39;)
    public phoneForm: FormGroup;
    public phoneTypes = [
       { value: &quot;home&quot;, name: &quot;HOME&quot;, desc: &quot;For home phone&quot; },
       { value: &quot;sms&quot;, name: &quot;SMS&quot;, desc: &quot;For text messaging&quot; },
       { value: &quot;tty&quot;, name: &quot;TTY&quot;, desc: &quot;For the deaf&quot; },
    ]
    
    onClick(phoneType) {
      console.log(phoneType);
    }
}
&lt;/pre&gt;
&lt;h4 class=&quot;code-header tltheader&quot;&gt; phone.template.html&lt;/h4&gt;
&lt;pre&gt;
&amp;lt;div [formGroup]=&amp;quot;phoneForm&amp;quot;&amp;gt;
    &amp;lt;div class=&amp;quot;form-group col-xs-6&amp;quot;&amp;gt;
        &amp;lt;label&amp;gt;Phone number&amp;lt;/label&amp;gt;
        &amp;lt;input type=&amp;quot;text&amp;quot; class=&amp;quot;form-control&amp;quot; placeholder=&amp;quot;Phone&amp;quot; formControlName=&amp;quot;phone&amp;quot;&amp;gt;
    &amp;lt;/div&amp;gt;
    &amp;lt;div class=&amp;quot;form-group col-xs-6&amp;quot;&amp;gt;
        &amp;lt;label&amp;gt;Phone Type&amp;lt;/label&amp;gt;
        &amp;lt;select class=&amp;quot;form-control&amp;quot; formControlName=&amp;quot;phoneType&amp;quot; (ngModelChange)=&amp;quot;onClick($event)&amp;quot;&amp;gt;
          &amp;lt;option *ngFor=&amp;quot;let type of phoneTypes&amp;quot; value=&amp;quot;{{type.value}}&amp;quot; title=&amp;quot;{{type.desc}}&amp;quot;&amp;gt;{{type.name}}&amp;lt;/option&amp;gt;
        &amp;lt;/select&amp;gt;
    &amp;lt;/div&amp;gt;
&amp;lt;/div&amp;gt;
&lt;/pre&gt;


&lt;p&gt;Onclick of the add address or add phone number button, dynamic fields gets pushed.&lt;/p&gt;
&lt;pre&gt;
addAddress() {
    const control = &lt;FormArray&gt;this.myForm.controls[&#39;addresses&#39;];
    const addrCtrl = this.initAddress();
 
    control.push(addrCtrl);
}

addPhone(p?: {phone: string, phoneType: string}) {
    const control = &lt;FormArray&gt;this.myForm.controls[&#39;phones&#39;];
    const phnCtrl = this.initPhone(p);
 
    control.push(phnCtrl);
}
&lt;/pre&gt;

&lt;p&gt;You can deleted the respective address or the phone field by clicking or the X button.&lt;/p&gt;
&lt;pre&gt;
removeAddress(i: number) {
    const control = &lt;FormArray&gt;this.myForm.controls[&#39;addresses&#39;];
    control.removeAt(i);
}

removePhone(i: number) {
    const control = &lt;FormArray&gt;this.myForm.controls[&#39;phones&#39;];
    control.removeAt(i);
}
&lt;/pre&gt;

&lt;h4 class=&quot;default-header tltheader&quot;&gt; How do we update the form value?&lt;/h4&gt;
&lt;p&gt;Now, imagine we need to assign default user’s name John to the field.&lt;/p&gt;
&lt;pre&gt;
this.myForm = this._fb.group({
    name: [&#39;John&#39;, [ &lt;any&gt;Validators.required, &lt;any&gt;Validators.minLength(5)]]
});
&lt;/pre&gt;
&lt;p&gt;What if John is not a static value? We only get the value from API call after we initialize the form model. We can do this:&lt;/p&gt;
&lt;pre&gt;
(&lt;FormControl&gt;this.myForm.controls[&#39;name&#39;]).setValue(&#39;John&#39;, { onlySelf: true });
&lt;/pre&gt;
&lt;p&gt;The form control exposes a function call &lt;code&gt;setValue&lt;/code&gt; which we can call to update our form control value.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;setValue&lt;/code&gt; accept optional parameter. In our case, we pass in { onlySelf: true }, mean this change will only affect the validation of this control and not its parent component.&lt;/p&gt;
&lt;p&gt;By default this.myForm.controls[&#39;name&#39;] is of type AbstractControl. AbstractControl is the base class of FormGroup and FormControl. Therefore, we need to cast it to FormControl in order to utilize control specific function.&lt;/p&gt;

&lt;h4 class=&quot;default-header tltheader&quot;&gt; How about updating the whole form model?&lt;/h4&gt;
&lt;p&gt;It&#39;s possible! We can do something like this:&lt;/p&gt;
&lt;pre&gt;
const people = {
    name: &#39;Jane&#39;,
    address: {
        street: &#39;High street&#39;,
        postcode: &#39;94043&#39;
    },
    phone: {
        phone: &#39;(502) 555-1234&#39;,
        phoneType: &#39;SMS&#39;
    }
};

(&lt;FormGroup&gt;this.myForm).setValue(people, { onlySelf: true });
&lt;/pre&gt;

&lt;h4 class=&quot;default-header tltheader&quot;&gt; Listen to form and controls changes&lt;/h4&gt;
&lt;p&gt;With reactive forms, we can listen to form or control changes easily. Each form group or form control expose a few events which we can subscribe to (e.g. statusChanges, valuesChanges, etc).&lt;/p&gt;
&lt;p&gt;Let say we want to do something every time when any form values changed. We can do this:&lt;/p&gt;
&lt;pre&gt;
subcribeToFormChanges() {
    // initialize stream
    const myFormValueChanges$ = this.myForm.valueChanges;

    // subscribe to the stream 
    myFormValueChanges$.subscribe(x =&gt; this.events
        .push({ event: ‘STATUS CHANGED’, object: x }));
}
&lt;/pre&gt;
&lt;p&gt;Then call this function in our &lt;code&gt;ngOnInit()&lt;/code&gt;.&lt;/p&gt;
&lt;pre&gt;
ngOnInit() {
    // subscribe to form changes 
    this.subcribeToFormChanges();
}
&lt;/pre&gt;
&lt;p&gt;Then display all value changes event in our view.&lt;/p&gt;
&lt;pre&gt;
&amp;lt;div *ngFor=&amp;quot;let event of events&amp;quot;&amp;gt;
    &amp;lt;pre&amp;gt; {{ event | json }} &amp;lt;/pre&amp;gt;
&amp;lt;/div&amp;gt;
&lt;/pre&gt;

&lt;p&gt;By clicking on the submit button, the values entered or selected in the fields are pushed as an object. An API call can be called in this function&lt;/p&gt;
&lt;p&gt;With the new forms module, we can use formArray to create a list of controls. We can seperate each group of controls to a new component.&lt;/p&gt;


&lt;h4 class=&quot;note-header tltheader&quot;&gt; Note:&lt;/h4&gt;
&lt;p&gt;&lt;em&gt;Courtesy: Scotch.io, Stack overflow&lt;/em&gt;&lt;/p&gt;

&lt;a href=&quot;http://lab.thelittletechie.com/craft/4/&quot; class=&quot;demo-button&quot;&gt;demo&lt;/a&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://thelittletechie.blogspot.com/feeds/6473312818603083625/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://thelittletechie.blogspot.com/2017/08/model-driven-forms-in-angular-2.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8625939250791601558/posts/default/6473312818603083625'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8625939250791601558/posts/default/6473312818603083625'/><link rel='alternate' type='text/html' href='http://thelittletechie.blogspot.com/2017/08/model-driven-forms-in-angular-2.html' title='Model Driven Forms in Angular 2'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgenmZj4wfNzAKePkvjiG6mxRZ3KtmWIVxgCyNciyBPpAYRjVUw0HeMsyD5M_bB68XQ-8cgJ-jgyBoazbktx4TxIKMFo0Gk2grYPym5KtU1M82X3fIaIeTCfRyscFO00NHxoGpyfuhXkaI/s72-c/Model-Driven-Forms-in-Angular-2.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8625939250791601558.post-2303178250210421223</id><published>2017-02-05T16:47:00.000+05:30</published><updated>2017-03-24T23:06:39.465+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="all"/><category scheme="http://www.blogger.com/atom/ns#" term="css3"/><category scheme="http://www.blogger.com/atom/ns#" term="html"/><title type='text'>Responsive scroll icon</title><content type='html'>&lt;div class=&quot;tltpost&quot;&gt;
&lt;div class=&quot;tltimg&quot;&gt;
&lt;a href=&quot;/2015/04/responsive-scroll-icon.html#tlt&quot;&gt;&lt;img src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiGHqabdHPBildSdPdZEwCh3qMxkC36zBxpNfA0aCsZuPU0ApHVOI-0XWsK9TtSrzTrKXxINpAjgoipmeXoIMdTfyMjRk3-a0fXOI8XR0V9Mdh5ChhayjXcyzREaChBJLq_i9YrkWFX7BQ/s1600/Responsive-scroll-icon.jpg&quot; title=&quot;Responsive scroll icon&quot; alt=&quot;Responsive scroll icon&quot; /&gt;&lt;/a&gt;
&lt;/div&gt;

&lt;p&gt;On my &lt;a href=&quot;http://www.thelittletechie.blogspot.com/2015/04/scroll-to-down-icon.html&quot;&gt;last post&lt;/a&gt; i have shown how to create a scroll to down icon. Now i tried a responsive design where mouse is shown on larger devices like desktop and phone on smaller devices like mobile. Check this put on your various devices.&lt;/p&gt;

&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;

&lt;h4 class=&quot;code-header tltheader&quot;&gt; HTML&lt;/h4&gt;
&lt;pre&gt;
&amp;lt;div class=&#39;icon-scroll&#39;&amp;gt;
  &amp;lt;div class=&amp;quot;icon-scroll-screen&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;
&amp;lt;/div&amp;gt;
&lt;/pre&gt;

&lt;h4 class=&quot;code-header tltheader&quot;&gt; CSS&lt;/h4&gt;
&lt;pre&gt;
p {
  font-family: &#39;Roboto Slab&#39;;
  text-align: center;
}

.icon-scroll,
.icon-scroll:before {
  position: absolute;
  left: 50%;
}

.icon-scroll {
  width: 40px;
  margin-left: -20px;
  top: 50%;
  margin-top: -35px;
  box-shadow: inset 0 0 0 1px #000;
  border-radius: 25px;
  height: 70px;
}

.icon-scroll:before {
  content: &#39;&#39;;
  width: 8px;
  height: 8px;
  background: #000;
  margin-left: -4px;
  top: 8px;
  border-radius: 4px;
  -webkit-animation-duration: 1.5s;
  animation-duration: 1.5s;
  -webkit-animation-iteration-count: infinite;
  animation-iteration-count: infinite;
  -webkit-animation-name: scroll;
  animation-name: scroll;
}

@-webkit-keyframes scroll {
  0% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    -webkit-transform: translateY(46px);
    transform: translateY(46px);
  }
}

@keyframes scroll {
  0% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    -webkit-transform: translateY(46px);
    transform: translateY(46px);
  }
}

@media only screen and (max-device-width: 768px) {
  .icon-scroll {
    height: 80px;
    border-radius: 4px;
  }
  .icon-scroll:after {
    content: &#39;&#39;;
    display: block;
    width: 7px;
    height: 7px;
    margin: 1px auto 0 auto;
    border: 1px solid #000;
    border-radius: 50%;
  }
  .icon-scroll-screen {
    position: relative;
    width: 34px;
    height: 56px;
    margin: 10px auto 0;
    border: 1px solid #000;
  }
  .icon-scroll:before {
    top: 58px;
  }
  @-webkit-keyframes scroll {
    0% {
      opacity: 1;
    }
    100% {
      opacity: 0;
      -webkit-transform: translateY(-46px);
      transform: translateY(-46px);
    }
  }
  @keyframes scroll {
    0% {
      opacity: 1;
    }
    100% {
      opacity: 0;
      -webkit-transform: translateY(-46px);
      transform: translateY(-46px);
    }
  }
}
&lt;/pre&gt;

&lt;h4 class=&quot;note-header tltheader&quot;&gt; Note:&lt;/h4&gt;
&lt;p&gt;&lt;em&gt;Try out on all your devices.&lt;/em&gt;&lt;/p&gt;

&lt;a href=&quot;http://lab.thelittletechie.com/craft/1/&quot; class=&quot;demo-button&quot;&gt;demo&lt;/a&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://thelittletechie.blogspot.com/feeds/2303178250210421223/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://thelittletechie.blogspot.com/2015/04/responsive-scroll-icon.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8625939250791601558/posts/default/2303178250210421223'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8625939250791601558/posts/default/2303178250210421223'/><link rel='alternate' type='text/html' href='http://thelittletechie.blogspot.com/2015/04/responsive-scroll-icon.html' title='Responsive scroll icon'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiGHqabdHPBildSdPdZEwCh3qMxkC36zBxpNfA0aCsZuPU0ApHVOI-0XWsK9TtSrzTrKXxINpAjgoipmeXoIMdTfyMjRk3-a0fXOI8XR0V9Mdh5ChhayjXcyzREaChBJLq_i9YrkWFX7BQ/s72-c/Responsive-scroll-icon.jpg" height="72" width="72"/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8625939250791601558.post-4518101734210993190</id><published>2017-02-05T16:45:00.000+05:30</published><updated>2017-03-24T23:35:07.158+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="all"/><category scheme="http://www.blogger.com/atom/ns#" term="css3"/><category scheme="http://www.blogger.com/atom/ns#" term="html"/><category scheme="http://www.blogger.com/atom/ns#" term="jquery"/><category scheme="http://www.blogger.com/atom/ns#" term="material design"/><title type='text'>Material Design Transition Popup</title><content type='html'>&lt;div class=&quot;tltpost&quot;&gt;
&lt;div class=&quot;tltimg&quot;&gt;
&lt;a href=&quot;/2015/05/material-design-transition-popup.html#tlt&quot;&gt;&lt;img src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiyQV0k-H3HYQPoThdWwqr5tExUc7fE7_ft5GwC_c-3X8TuUsUeaSrmf-SJ4Zznxoq5i_uCzMNZlfxpuyS92uvReezBGKgm6XK3WAXWe8BeDODeXKfOegifZKk6-MpyVWkTvv8aOFdhpUE/s1600/Material-Design-Transition-Popup.jpg&quot; title=&quot;Material Design Transition Popup&quot; alt=&quot;Material Design Transition Popup&quot; /&gt;&lt;/a&gt;
&lt;/div&gt;

&lt;p&gt;Android 5.0 brings Material design to Android and gives you an expanded UI toolkit for integrating the new design patterns easily in your apps. This is one of the transitions used.&lt;/p&gt;

&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;

&lt;h4 class=&quot;code-header tltheader&quot;&gt; HTML&lt;/h4&gt;
&lt;pre&gt;
&amp;lt;h1&amp;gt;Material Design Transition&amp;lt;/h1&amp;gt;
&amp;lt;div class=&#39;wrap&#39;&amp;gt;
  &amp;lt;div class=&#39;content&#39;&amp;gt;
    &amp;lt;h2&amp;gt;Well Hello!&amp;lt;/h2&amp;gt;
    &amp;lt;p&amp;gt;contents...&amp;lt;/p&amp;gt;
  &amp;lt;/div&amp;gt;
&amp;lt;/div&amp;gt;
&amp;lt;a class=&#39;button glyphicon glyphicon-plus&#39; href=&#39;#&#39;&amp;gt;&amp;lt;/a&amp;gt;
&lt;/pre&gt;

&lt;h4 class=&quot;code-header tltheader&quot;&gt; CSS&lt;/h4&gt;
&lt;pre&gt;
body {
  background: #e6e6e6;
  width: 100%;
  height: 100vh;
  position: relative;
}

h1 {
  color: #c7c7c7;
  font-weight: 200;
  text-align: center;
  position: absolute;
  top: 45%;
  width: 100%;
}

h2 {
  color: #007fed;
  font-weight: bold;
  border-bottom: 1px solid #eee;
  padding-bottom: 15px;
  margin-bottom: 15px;
}

p {
  color: #001818;
}

.wrap {
  position: absolute;
  overflow: hidden;
  top: 10%;
  right: 10%;
  bottom: 85px;
  left: 10%;
  padding: 20px 50px;
  display: block;
  border-radius: 4px;
  transform: translateY(20px);
  transition: all 0.5s;
  visibility: hidden;
}
.wrap .content {
  opacity: 0;
}
.wrap:before {
  position: absolute;
  width: 1px;
  height: 1px;
  background: white;
  content: &quot;&quot;;
  bottom: 10px;
  left: 50%;
  top: 95%;
  color: #fff;
  border-radius: 50%;
  -webkit-transition: all 600ms cubic-bezier(0.215, 0.61, 0.355, 1);
  transition: all 600ms cubic-bezier(0.215, 0.61, 0.355, 1);
}
.wrap.active {
  display: block;
  visibility: visible;
  box-shadow: 2px 3px 16px silver;
  transition: all 600ms;
  transform: translateY(0px);
  transition: all 0.5s;
}
.wrap.active:before {
  height: 2000px;
  width: 2000px;
  border-radius: 50%;
  top: 50%;
  left: 50%;
  margin-left: -1000px;
  margin-top: -1000px;
  display: block;
  -webkit-transition: all 600ms cubic-bezier(0.215, 0.61, 0.355, 1);
  transition: all 600ms cubic-bezier(0.215, 0.61, 0.355, 1);
}
.wrap.active .content {
  position: relative;
  z-index: 1;
  opacity: 1;
  transition: all 600ms cubic-bezier(0.55, 0.055, 0.675, 0.19);
}

a.button {
  padding: 11px 11px 13px 13px;
  outline: none;
  border-radius: 50%;
  background: #007fed;
  color: #fff;
  font-size: 24px;
  display: block;
  position: fixed;
  left: 50%;
  bottom: 20px;
  top: auto;
  margin-left: -25px;
  text-decoration: none;
  transition: transform 0.25s;
}
a.button:hover {
  text-decoration: none;
  background: #2198ff;
}
a.button.active {
  transform: rotate(135deg);
  transition: transform 0.5s;
}

&lt;/pre&gt;

&lt;h4 class=&quot;code-header tltheader&quot;&gt; jQuery&lt;/h4&gt;
&lt;pre&gt;
$(&#39;a&#39;).on(&#39;click&#39;, function(){
  $(&#39;.wrap, a&#39;).toggleClass(&#39;active&#39;);
  return false;
});
&lt;/pre&gt;

&lt;h4 class=&quot;attachment-header tltheader&quot;&gt; Attachments:&lt;/h4&gt;
&lt;p&gt;I have used external attachments.&lt;/p&gt;
&lt;pre&gt;
//maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css
&lt;/pre&gt;

&lt;a href=&quot;http://lab.thelittletechie.com/craft/2/&quot; class=&quot;demo-button&quot;&gt;demo&lt;/a&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://thelittletechie.blogspot.com/feeds/4518101734210993190/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://thelittletechie.blogspot.com/2015/05/material-design-transition-popup.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8625939250791601558/posts/default/4518101734210993190'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8625939250791601558/posts/default/4518101734210993190'/><link rel='alternate' type='text/html' href='http://thelittletechie.blogspot.com/2015/05/material-design-transition-popup.html' title='Material Design Transition Popup'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiyQV0k-H3HYQPoThdWwqr5tExUc7fE7_ft5GwC_c-3X8TuUsUeaSrmf-SJ4Zznxoq5i_uCzMNZlfxpuyS92uvReezBGKgm6XK3WAXWe8BeDODeXKfOegifZKk6-MpyVWkTvv8aOFdhpUE/s72-c/Material-Design-Transition-Popup.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8625939250791601558.post-6240835553427362974</id><published>2017-01-01T18:31:00.000+05:30</published><updated>2017-02-05T16:36:52.479+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="all"/><category scheme="http://www.blogger.com/atom/ns#" term="tlt"/><title type='text'>Best Wishes App</title><content type='html'>&lt;div class=&quot;tltpost&quot;&gt;
&lt;div class=&quot;tltimg&quot;&gt;
&lt;a href=&quot;/2017/01/my-wishes-app.html#tlt&quot;&gt;&lt;img src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhYoWuU8lbCxDsp8-10BnonqmEwi_GfDG_y567Y9GqG8Lmia6ph760msuKqlBa0_wA2AUnHkv3pE4n30jf0f3r-OLsjhp_TSVj7-lBnrEL8gkVeSho76CSaBCNVdo7lNiCF4bYVUc_0wrI/s1600/My-Wishes-App.png&quot; title=&quot;Best Wishes App&quot; alt=&quot;Best Wishes App&quot; /&gt;&lt;/a&gt;
&lt;/div&gt;

&lt;p&gt;This is an Angular JS and Google&#39;s Firebase project. Greet your loved ones by creating your own website link in a matter of seconds. A new idea to send your best wishes. More customization can be done in near future. It is a clean app without any ad and user friendly.&lt;/p&gt;

&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;

&lt;p&gt;Now it is live on Google play store.&lt;/p&gt;

&lt;a href=&#39;https://goo.gl/prWoyc&#39;&gt;&lt;img alt=&#39;Get it on Google Play&#39; src=&#39;https://play.google.com/intl/en_us/badges/images/generic/en_badge_web_generic.png&#39; style=&quot;width: 200px&quot; /&gt;&lt;/a&gt;

&lt;h4 class=&quot;note-header tltheader&quot;&gt; Link:&lt;/h4&gt;
&lt;p&gt;&lt;em&gt;https://tltapp.github.io/wishes&lt;/em&gt;&lt;/p&gt;

&lt;a href=&quot;https://tltapp.github.io/wishes/#!/&quot; class=&quot;demo-button&quot;&gt;view&lt;/a&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://thelittletechie.blogspot.com/feeds/6240835553427362974/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://thelittletechie.blogspot.com/2017/01/my-wishes-app.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8625939250791601558/posts/default/6240835553427362974'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8625939250791601558/posts/default/6240835553427362974'/><link rel='alternate' type='text/html' href='http://thelittletechie.blogspot.com/2017/01/my-wishes-app.html' title='Best Wishes App'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhYoWuU8lbCxDsp8-10BnonqmEwi_GfDG_y567Y9GqG8Lmia6ph760msuKqlBa0_wA2AUnHkv3pE4n30jf0f3r-OLsjhp_TSVj7-lBnrEL8gkVeSho76CSaBCNVdo7lNiCF4bYVUc_0wrI/s72-c/My-Wishes-App.png" height="72" width="72"/><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8625939250791601558.post-4674866751074378189</id><published>2016-12-29T15:30:00.000+05:30</published><updated>2017-02-05T16:37:41.168+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="all"/><category scheme="http://www.blogger.com/atom/ns#" term="Cordova. Android"/><category scheme="http://www.blogger.com/atom/ns#" term="Hybrid App"/><title type='text'>How to sign an unsigned android apk</title><content type='html'>&lt;div class=&quot;tltpost&quot;&gt;
&lt;div class=&quot;tltimg&quot;&gt;
&lt;a href=&quot;/2016/12/how-to-sign-unsigned-android-apk.html#tlt&quot;&gt;&lt;img src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgItI9S4I8o3buF1QRuQXS_qOMYBVynaHax0M-9q0qce353SJWaX8JPhFi_xz4uJp6jAoqAxv7_wQVDS-DOCdiHsFk6uIUerlscLGPtysS8b9aEJo8HrusIzHkmEbqXzdsrXpqsviV7AN4/s1600/How-to-sign-an-unsigned-android-apk.png&quot; title=&quot;How to sign an unsigned android apk&quot; alt=&quot;How to sign an unsigned android apk&quot; /&gt;&lt;/a&gt;
&lt;/div&gt;

&lt;p&gt;I have created an hybrid mobile app using web technologies like HTML5, CSS3, AngularJS and wrapped up with cordova and generated an android apk. This generated apk is unsigned. We have to add a certificate to the unsigned apk file.&lt;/p&gt;

&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;

&lt;p&gt;It means digitally signing the applications with a certificate as a means of identifying the author of an application and establishing trust relationships between applications. Let us look on how to sign in detail.&lt;/p&gt;

&lt;p&gt;As i am using cordova, run the below command in command prompt from inside your project folder to build an app.&lt;/p&gt;
&lt;pre&gt;
cordova build android --release
&lt;/pre&gt;

&lt;p&gt;This generates an unsigned apk file in the following folder.&lt;/p&gt;
&lt;pre&gt;
PROJECT_FOLDER/platforms/android/build/outputs/apk/android-release-unsigned.apk
&lt;/pre&gt;

&lt;p&gt;Copy this file to the root of your project folder and rename it to app.apk (Just for convenience)&lt;/p&gt;
&lt;p&gt;To sign an unsigned apk we will need to do that by using a number of the tools provided by Java to &quot;sign&quot; our application. The first utility we will utilize is the “keytool.” The keytool utility is part of what ships with the Java Development Kit (JDK). In my system it is installed in the following location.&lt;/p&gt;
&lt;pre&gt;
C:\Program Files\Java\jdk1.8.0_91\bin\keytool.exe
&lt;/pre&gt;
&lt;p&gt;Now run the below command.&lt;/p&gt;
&lt;pre&gt;
keytool -genkey -v -keystore the-little-techie.keystore -alias the-little-techie -keyalg RSA -keysize 2048 -validity 10000
&lt;/pre&gt;

&lt;p&gt;Now we will take the .keystore file that was created with the keytool utility and sign it using another utility that ships with the JDK called “jarsigner.exe.” My jarsigner is installed in the below location.&lt;/p&gt;
&lt;pre&gt;
C:\Program Files\Java\jdk1.8.0_91\bin\jarsigner.exe
&lt;/pre&gt;
&lt;p&gt;Now run the below command.&lt;/p&gt;
&lt;pre&gt;
jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore the-little-techie.keystore app.apk the-little-techie
&lt;/pre&gt;

&lt;p&gt;Now that we have signed the .apk file we will use the &quot;zipalign&quot; tool to prepare our application for release. The &quot;ZipAlaign&quot; tool can be found in the Android SDK directory. Mine is found in the below location.&lt;/p&gt;
&lt;pre&gt;
C:\Users\VIVIN ANTONY\AppData\Local\Android\Sdk\build-tools\19.1.0\zipalign
&lt;/pre&gt;

&lt;p&gt;We can utilize it by running the following command on our signed .apk file.&lt;/p&gt;
&lt;pre&gt;
zipalign -v 4 app.apk thelittletechie_final.apk
&lt;/pre&gt;

&lt;p&gt;This will create a zip aligned .apk file. Now the app is ready to publish to play store.&lt;/p&gt;

&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://thelittletechie.blogspot.com/feeds/4674866751074378189/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://thelittletechie.blogspot.com/2016/12/how-to-sign-unsigned-android-apk.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8625939250791601558/posts/default/4674866751074378189'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8625939250791601558/posts/default/4674866751074378189'/><link rel='alternate' type='text/html' href='http://thelittletechie.blogspot.com/2016/12/how-to-sign-unsigned-android-apk.html' title='How to sign an unsigned android apk'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgItI9S4I8o3buF1QRuQXS_qOMYBVynaHax0M-9q0qce353SJWaX8JPhFi_xz4uJp6jAoqAxv7_wQVDS-DOCdiHsFk6uIUerlscLGPtysS8b9aEJo8HrusIzHkmEbqXzdsrXpqsviV7AN4/s72-c/How-to-sign-an-unsigned-android-apk.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8625939250791601558.post-1741120384801476947</id><published>2016-12-06T11:13:00.002+05:30</published><updated>2017-02-05T16:38:01.450+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="all"/><category scheme="http://www.blogger.com/atom/ns#" term="info"/><category scheme="http://www.blogger.com/atom/ns#" term="tricks"/><title type='text'>Deleting longer path using rimraf</title><content type='html'>&lt;div class=&quot;tltpost&quot;&gt;
&lt;div class=&quot;tltimg&quot;&gt;
&lt;a href=&quot;/2016/12/deleting-longer-path-using-rimraf.html#tlt&quot;&gt;&lt;img src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiR5alkUbox8ZxRbkkzYluEAZ1s146a_TKEt_rtcfeKv78otrixCTrWQwMVZ_3jSJBi8PIGdWrmdv_aqcG6_xxuZ6eOeU_m4itVt4GIpD5lK4tZbZs2p_M5KHbL_iFizN72SPvlhb8nz0Y/s1600/Deleting-longer-path-using-rimraf.jpg&quot; title=&quot;Deleting longer path using rimraf&quot; alt=&quot;Deleting longer path using rimraf&quot; /&gt;&lt;/a&gt;
&lt;/div&gt;

&lt;p&gt;The npm packages gets installed locally in node_modules folder. On trying to deleted the folder you will get a message saying &quot;The source file name(s) are larger than is supported by the file system.&lt;/p&gt;

&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;

&lt;p&gt;Try moving to a location which has a shorter path name, or try renaming to shorter name(s) before attempting this operation&quot;.&lt;/p&gt;
&lt;p&gt;This happens because of the nesting of folders.&lt;/p&gt;
&lt;p&gt;To delete this successfully you can use RimRaf.&lt;/p&gt;
&lt;p&gt;Install RimRaf globally in your system.&lt;/p&gt;

&lt;pre&gt;
npm install -g rimraf
&lt;/pre&gt;

&lt;p&gt;Now go the directory for which you want to remove the node_modules in command prompt and run the below command.&lt;/p&gt;
&lt;pre&gt;
rimraf node_modules
&lt;/pre&gt;

&lt;h4 class=&quot;note-header tltheader&quot;&gt; Note:&lt;/h4&gt;
&lt;p&gt;&lt;em&gt;You can do this for deleting any longer folder path.&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://thelittletechie.blogspot.com/feeds/1741120384801476947/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://thelittletechie.blogspot.com/2016/12/deleting-longer-path-using-rimraf.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8625939250791601558/posts/default/1741120384801476947'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8625939250791601558/posts/default/1741120384801476947'/><link rel='alternate' type='text/html' href='http://thelittletechie.blogspot.com/2016/12/deleting-longer-path-using-rimraf.html' title='Deleting longer path using rimraf'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiR5alkUbox8ZxRbkkzYluEAZ1s146a_TKEt_rtcfeKv78otrixCTrWQwMVZ_3jSJBi8PIGdWrmdv_aqcG6_xxuZ6eOeU_m4itVt4GIpD5lK4tZbZs2p_M5KHbL_iFizN72SPvlhb8nz0Y/s72-c/Deleting-longer-path-using-rimraf.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8625939250791601558.post-59269356533743078</id><published>2016-08-07T01:11:00.001+05:30</published><updated>2017-03-24T23:56:25.274+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="all"/><category scheme="http://www.blogger.com/atom/ns#" term="html"/><title type='text'>How to change the color of address bar in mobile browser to match your website</title><content type='html'>&lt;div class=&quot;tltpost&quot;&gt;
&lt;div class=&quot;tltimg&quot;&gt;
&lt;a href=&quot;/2016/08/how-to-change-color-of-address-bar-in.html#tlt&quot;&gt;&lt;img src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi4mYNsIJIXJ4dAFjYA5VTTb98P2qD_gU2w0i1Z1qxgc1qiNBZBKEZ3-F9invqwnG7vR-zsZ0RNvUH7fQbGSj7fyYjaK4Bpm96CNUN_OTw_XuaT7TX9wKw28OT45bPSgWUMeIILfADa0_k/s1600/How-to-change-the-color-of-address-bar-in-mobile-browser-to-match-your-website.jpg&quot; title=&quot;How to change the color of address bar in mobile browser to match your website&quot; alt=&quot;How to change the color of address bar in mobile browser to match your website&quot; /&gt;&lt;/a&gt;
&lt;/div&gt;

&lt;p&gt;Nowadays most of the websites are responsive websites. This makes your site looks great on mobile devices. However, it still looks and feels like a website. Matching the color of address bar to your website, gives it a native app-like feel. This improves user experience.&lt;/p&gt;

&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;

&lt;p&gt;Simply add the below meta tag to head section of your page.&lt;/p&gt;

&lt;h4 class=&quot;code-header tltheader&quot;&gt; HTML&lt;/h4&gt;
&lt;pre&gt;
&amp;lt;!-- Chrome, Firefox OS, Opera--&amp;gt;
&amp;lt;meta name=&amp;quot;theme-color&amp;quot; content=&amp;quot;#4285f4&amp;quot;&amp;gt;
&amp;lt;!-- Windows Phone --&amp;gt;
&amp;lt;meta name=&amp;quot;msapplication-navbutton-color&amp;quot; content=&amp;quot;#4285f4&amp;quot;&amp;gt;
&amp;lt;!-- iOS Safari --&amp;gt;
&amp;lt;meta name=&amp;quot;apple-mobile-web-app-status-bar-style&amp;quot; content=&amp;quot;#4285f4&amp;quot;&amp;gt;
&lt;/pre&gt;

&lt;p&gt;The content field has the hex code for the color you want to use as theme color.&lt;/p&gt;

&lt;h4 class=&quot;note-header tltheader&quot;&gt; Note:&lt;/h4&gt;
&lt;p&gt;&lt;em&gt;I have tested this with android phones alone.&lt;/em&gt;&lt;/p&gt;

&lt;a href=&quot;http://lab.thelittletechie.com/craft/3/&quot; class=&quot;demo-button&quot;&gt;demo&lt;/a&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://thelittletechie.blogspot.com/feeds/59269356533743078/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://thelittletechie.blogspot.com/2016/08/how-to-change-color-of-address-bar-in.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8625939250791601558/posts/default/59269356533743078'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8625939250791601558/posts/default/59269356533743078'/><link rel='alternate' type='text/html' href='http://thelittletechie.blogspot.com/2016/08/how-to-change-color-of-address-bar-in.html' title='How to change the color of address bar in mobile browser to match your website'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi4mYNsIJIXJ4dAFjYA5VTTb98P2qD_gU2w0i1Z1qxgc1qiNBZBKEZ3-F9invqwnG7vR-zsZ0RNvUH7fQbGSj7fyYjaK4Bpm96CNUN_OTw_XuaT7TX9wKw28OT45bPSgWUMeIILfADa0_k/s72-c/How-to-change-the-color-of-address-bar-in-mobile-browser-to-match-your-website.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8625939250791601558.post-7160350940992392249</id><published>2016-08-06T21:20:00.002+05:30</published><updated>2017-09-01T23:45:50.172+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="all"/><category scheme="http://www.blogger.com/atom/ns#" term="Angular.js"/><category scheme="http://www.blogger.com/atom/ns#" term="css3"/><category scheme="http://www.blogger.com/atom/ns#" term="ionic"/><title type='text'>Make modal to slide from right in ionic</title><content type='html'>&lt;div class=&quot;tltpost&quot;&gt;
&lt;div class=&quot;tltimg&quot;&gt;
&lt;a href=&quot;/2016/08/make-modal-to-slide-from-right-in-ionic.html#tlt&quot;&gt;&lt;img src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgkoyUGtVhsfUiiI1pX5T0FY5bzg5_ikKqotXqJ4ND8PWLkxc5VBoQBHbwDnUl3UKW8u_oioWhHh_Yrn9wAUhFCkeT117PEvkAuhLN_CF0Skdem4JNhubvMo_CQAZgE31KKahLr8H_7mOM/s1600/Make-modal-to-slide-from-right-in-ionic.jpg&quot; title=&quot;Make modal to slide from right in ionic&quot; alt=&quot;Make modal to slide from right in ionic&quot; /&gt;&lt;/a&gt;
&lt;/div&gt;

&lt;p&gt;In ionic version 1 you can find modal sliding from bottom to top called as slide-in-up. This is default and there is no option to make it slide from right to left or left to right.&lt;/p&gt;

&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;

&lt;p&gt;So i thought to write animation sliding in CSS3 where the modal slides in from right to left called as slide-in-right. Here you can see how it&#39;s done.&lt;/p&gt;

&lt;h4 class=&quot;code-header tltheader&quot;&gt; CSS&lt;/h4&gt;
&lt;pre&gt;
.slide-in-right {
    -webkit-transform: translateX(100%);
    transform: translateX(100%);
}

.slide-in-right.ng-enter,
.slide-in-right &gt; .ng-enter {
    -webkit-transition: all cubic-bezier(0.1, 0.7, 0.1, 1) 400ms;
    transition: all cubic-bezier(0.1, 0.7, 0.1, 1) 400ms;
}

.slide-in-right.ng-enter-active,
.slide-in-right &gt; .ng-enter-active {
    -webkit-transform: translateX(0);
    transform: translateX(0);
}

.slide-in-right.ng-leave,
.slide-in-right &gt; .ng-leave {
    -webkit-transition: all ease-in-out 250ms;
    transition: all ease-in-out 250ms;
}
&lt;/pre&gt;

&lt;p&gt;Call that animation name in AngularJS controller.&lt;/p&gt;

&lt;h4 class=&quot;code-header tltheader&quot;&gt; Javascript&lt;/h4&gt;
&lt;pre&gt;
 $ionicModal.fromTemplateUrl(&#39;TEMPLATE-URL.html&#39;, {
     scope: $scope,
     animation: &#39;slide-in-right&#39;
 }).then(function(modal) {
        ...
 });
&lt;/pre&gt;

&lt;a href=&quot;http://lab.thelittletechie.com/craft/5/&quot; class=&quot;demo-button&quot;&gt;demo&lt;/a&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://thelittletechie.blogspot.com/feeds/7160350940992392249/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://thelittletechie.blogspot.com/2016/08/make-modal-to-slide-from-right-in-ionic.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8625939250791601558/posts/default/7160350940992392249'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8625939250791601558/posts/default/7160350940992392249'/><link rel='alternate' type='text/html' href='http://thelittletechie.blogspot.com/2016/08/make-modal-to-slide-from-right-in-ionic.html' title='Make modal to slide from right in ionic'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgkoyUGtVhsfUiiI1pX5T0FY5bzg5_ikKqotXqJ4ND8PWLkxc5VBoQBHbwDnUl3UKW8u_oioWhHh_Yrn9wAUhFCkeT117PEvkAuhLN_CF0Skdem4JNhubvMo_CQAZgE31KKahLr8H_7mOM/s72-c/Make-modal-to-slide-from-right-in-ionic.jpg" height="72" width="72"/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8625939250791601558.post-3286863161555831020</id><published>2016-04-13T14:54:00.001+05:30</published><updated>2017-02-22T22:17:23.855+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="all"/><category scheme="http://www.blogger.com/atom/ns#" term="Angular.js"/><category scheme="http://www.blogger.com/atom/ns#" term="Express.js"/><category scheme="http://www.blogger.com/atom/ns#" term="MongoDB"/><category scheme="http://www.blogger.com/atom/ns#" term="mongoose"/><category scheme="http://www.blogger.com/atom/ns#" term="Node.js"/><title type='text'>A simple CRUD application using MEAN and mongoose</title><content type='html'>&lt;div class=&quot;tltpost&quot;&gt;
&lt;div class=&quot;tltimg&quot;&gt;
&lt;a href=&quot;/2016/04/a-simple-crud-application-using-mean.html#tlt&quot;&gt;&lt;img src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjsH_ThaUKQNBG7LVx2DSwSBNRQnNh-U9tjND_P7Yb2uj1n0dGoDXVe3qz09fLpbzSn1niFy4eAeyF06_TP_P-GRhCQyRBLsvEnOtQaeZdmm4UqWSLorzQyTZeiE_45yDOgE6v-bWY-SNw/s1600/A-simple-CRUD-application-using-MEAN-and-mongoose.jpg&quot; title=&quot;A simple CRUD application using MEAN and mongoose&quot; alt=&quot;A simple CRUD application using MEAN and mongoose&quot; /&gt;&lt;/a&gt;
&lt;/div&gt;

&lt;p&gt;I am going to start explaining this with an example of creating a phonebook app using MongoDB, Angular.js, Express.js, Node.js and mongoose. Where you can create, view, delete and update a contact.&lt;/p&gt;

&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;

&lt;p&gt;Initially when i started learning about MEAN stack, I came across many websites and did not find in one particular site according to my needs. I surfed many websites to find my solution. Each solution was in different websites. So, i planned to write about it here, all in one place. Let&#39;s break this into steps.&lt;/p&gt;

&lt;h4 class=&quot;default-header tltheader&quot;&gt; What is MEAN?&lt;/h4&gt;
&lt;p&gt;MEAN stands for MongoDB, Express.js, Angular.js, Node.js&lt;/p&gt;
&lt;h4 class=&quot;default-header tltheader&quot;&gt; What is MongoDB?&lt;/h4&gt;
&lt;p&gt;MongoDB is the leading NoSQL database, empowering businesses to be more agile and scalable.&lt;/p&gt;
&lt;h4 class=&quot;default-header tltheader&quot;&gt; What is Express?&lt;/h4&gt;
&lt;p&gt;Express is a minimal and flexible node.js web application framework, providing a robust set of features for building single and multi-page, and hybrid web applications.&lt;/p&gt;
&lt;h4 class=&quot;default-header tltheader&quot;&gt; What is Angular.js?&lt;/h4&gt;
&lt;p&gt;AngularJS lets you extend HTML vocabulary for your application. The resulting environment is extraordinarily expressive, readable, and quick to develop.&lt;/p&gt;
&lt;h4 class=&quot;default-header tltheader&quot;&gt; What is Node.js?&lt;/h4&gt;
&lt;p&gt;Node.js is a platform built on Chrome&#39;s JavaScript runtime for easily building fast, scalable network applications.&lt;/p&gt;


&lt;p&gt;What all i am going to explain in this post?&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Creating a project folder with necessary packages&lt;/li&gt;
&lt;li&gt;Creating angular route, partials and controllers&lt;/li&gt;
&lt;li&gt;Creating mongo db&lt;/li&gt;
&lt;li&gt;Creating mongoose Schema&lt;/li&gt;
&lt;li&gt;Create the user&lt;/li&gt;
&lt;li&gt;View the user&lt;/li&gt;
&lt;li&gt;Delete the user&lt;/li&gt;
&lt;li&gt;update the user&lt;/li&gt;
&lt;/ol&gt;

&lt;h4 class=&quot;default-header tltheader&quot;&gt; Creating a project folder with necessary packages&lt;/h4&gt;
&lt;p&gt;Let&#39;s start by creating a project folder and installing the various packages required for our project. Let me create a folder name PhoneBookApp.&lt;/p&gt;

&lt;p&gt;Now lets install various packages that are necessary for creating our app. Before that, you should install node and npm to your PC. Installing node and npm is explained in detail &lt;a href=&quot;http://www.thelittletechie.com/2016/03/how-to-install-nodejs-and-npm-on-windows.html#tlt&quot;&gt;here&lt;/a&gt;. And using npm we have to install bower. It is explained in detail &lt;a href=&quot;http://www.thelittletechie.com/2016/03/how-to-install-bower-on-windows.html#tlt&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;After installing node and bower, we can start installing the node and bower components required. Our &lt;code&gt;node-modules&lt;/code&gt; include &lt;code&gt;express&lt;/code&gt;, &lt;code&gt;body-parser&lt;/code&gt; and &lt;code&gt;mongoose&lt;/code&gt;. Our &lt;code&gt;bower-components&lt;/code&gt; include &lt;code&gt;jquery&lt;/code&gt;, &lt;code&gt;bootstrap&lt;/code&gt;, &lt;code&gt;angular&lt;/code&gt;, &lt;code&gt;angular-route&lt;/code&gt;, &lt;code&gt;toastr&lt;/code&gt; and &lt;code&gt;font-awesome&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Here i am using bootstrap for styling, toastr for notification and font-awesome for icons. You can neglect this if you want.&lt;/p&gt;

&lt;h4 class=&quot;default-header tltheader&quot;&gt; Application Structure&lt;/h4&gt;
&lt;pre&gt;
--app
-----config
--------mongoose.js (setting up mongo db)
-----controller
--------AddCtrl.js (angular controller for add contact)
--------EditCtrl.js (angular controller for edit contact)
--------HomeCtrl.js (angular controller for home page)
--------ListCtrl.js (angular controller for list contact)
--------ViewCtrl.js (angular controller for view contact)
-----css
-----img
-----libs (created by bower install)
-----model
--------contact.js (mongoose schema to handle CRUD)
-----route
--------contact.js (service calls)
--------route.js (page routing)
-----view
--------add.html (html template for add contact)
--------edit.html (html template for edit contact)
--------home.html (html template for home page)
--------list.html (html template for list contact)
--------view.html (html template for view contact)
-----app.js
-----index.html
---node-modules (created by npm install)
---.bowerrc (tells bower where to put files &quot;app/libs&quot;)
---bower.json (tells bower which files we need)
---package.json (tells npm which packages we need)
---server.js (set up our node application)
&lt;/pre&gt;

&lt;h4 class=&quot;default-header tltheader&quot;&gt; Setting Up Our Node Application Server&lt;/h4&gt;
&lt;p&gt;The service file contains the port for which the localhost runs. Here you can specify the default location of the app. The mongoose, model schema and routes will be imported here.&lt;/p&gt;
&lt;h4 class=&quot;code-header tltheader&quot;&gt; server.js&lt;/h4&gt;
&lt;pre&gt;
var express = require(&#39;express&#39;),
    bodyParser = require(&#39;body-parser&#39;);

var app = express();
app.use(express.static(__dirname + &#39;/app&#39;));
app.use(bodyParser.json());
.
.
.
app.get(&#39;*&#39;, function(req, res) {
    res.sendfile(&#39;./app/index.html&#39;);
});

var port = &quot;3000&quot;;
app.listen(port);
console.log(&quot;Magic happens at &quot; + port);
&lt;/pre&gt;

&lt;p&gt;See how i have pulled in the module express.&lt;/p&gt;

&lt;p&gt;The default html page contains the scripts snd the styles that are required. The name of your app is defined in the &lt;code&gt;ng-app&lt;/code&gt; directive.&lt;/p&gt;
&lt;h4 class=&quot;code-header tltheader&quot;&gt; index.html&lt;/h4&gt;
&lt;pre&gt;
&amp;lt;html ng-app=&amp;quot;app&amp;quot;&amp;gt;
   &amp;lt;body&amp;gt;
      &amp;lt;div ng-view&amp;gt;&amp;lt;/div&amp;gt;
   &amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
&lt;/pre&gt;
&lt;p&gt;The templates inside view folder gets embedded into &lt;code&gt;ng-view&lt;/code&gt; when routing happens.&lt;/p&gt;

&lt;h4 class=&quot;default-header tltheader&quot;&gt; Routing&lt;/h4&gt;
&lt;p&gt;Routing is explained deeply &lt;a href=&quot;http://www.thelittletechie.com/2016/04/routing-in-angularjs-using-angular-route.html&quot;&gt;here&lt;/a&gt;, you can take a look at it.&lt;/p&gt;
&lt;h4 class=&quot;code-header tltheader&quot;&gt; route.js&lt;/h4&gt;
&lt;pre&gt;
angular.module(&#39;app&#39;).config(function($locationProvider, $routeProvider) {
   $locationProvider.html5Mode(true);

   $routeProvider
      .when(&#39;/&#39;, {
         templateUrl: &#39;view/home.html&#39;,
         controller: &#39;HomeController&#39;
      })
      .when(&#39;/add&#39;, {
         templateUrl: &#39;view/add.html&#39;,
         controller: &#39;AddController&#39;
      })
      .when(&#39;/list&#39;, {
         templateUrl: &#39;view/list.html&#39;,
         controller: &#39;ListController&#39;
      })
      .when(&#39;/view/:id&#39;, {
         templateUrl: &#39;view/view.html&#39;,
         controller: &#39;ViewController&#39;
      })
      .when(&#39;/edit/:id&#39;, {
         templateUrl: &#39;view/edit.html&#39;,
         controller: &#39;EditController&#39;
      })
});
&lt;/pre&gt;

&lt;p&gt;When &lt;code&gt;/add&lt;/code&gt; is clicked in index.html file, the &lt;code&gt;add.html&lt;/code&gt; template inside view folder gets embedded into &lt;code&gt;ng-view&lt;/code&gt; with controller &lt;code&gt;AddController&lt;/code&gt;. Same way the rest of the routing works. &lt;code&gt;/view/:id&lt;/code&gt; means when a particular contact is clicked the &lt;code&gt;:id&lt;/code&gt; gets the param id of the contact and get appended to it.&lt;/p&gt;

&lt;h4 class=&quot;default-header tltheader&quot;&gt; View and Controller&lt;/h4&gt;
&lt;p&gt;Let me show you each of my template and controller files, how i have written it.&lt;/p&gt;
&lt;h4 class=&quot;code-header tltheader&quot;&gt; add.html&lt;/h4&gt;
&lt;pre&gt;
&amp;lt;input placeholder=&amp;quot;First Name&amp;quot; ng-model=&amp;quot;contact.fname&amp;quot;&amp;gt;
&amp;lt;input placeholder=&amp;quot;Last Name&amp;quot; ng-model=&amp;quot;contact.lname&amp;quot;&amp;gt;
&amp;lt;button ng-click=&amp;quot;save()&amp;quot;&amp;gt;Save&amp;lt;/button&amp;gt;
&lt;/pre&gt;
&lt;p&gt;See how i have defined my &lt;code&gt;ng-model&lt;/code&gt;. When the save button is clicked the &lt;code&gt;save()&lt;/code&gt; function gets triggered in the &lt;code&gt;AddCtrl.js&lt;/code&gt; controller.&lt;/p&gt;
&lt;h4 class=&quot;code-header tltheader&quot;&gt; AddCtrl.js Controller&lt;/h4&gt;
&lt;pre&gt;
$scope.save = function() {
   $http.post(&#39;/api&#39;, $scope.contact).success(function(data) {
      $scope.contact = data;
      $location.path(&#39;/list&#39;);
   })
}
&lt;/pre&gt;
&lt;p&gt;The save function contains the service method &lt;code&gt;post&lt;/code&gt; which adds a new contact to the database.&lt;/p&gt;
&lt;p&gt;When adding contact is successful i have redirected to &lt;code&gt;list.html&lt;/code&gt; where the list of all the added contacts are shown.&lt;/p&gt;
&lt;h4 class=&quot;code-header tltheader&quot;&gt; list.html&lt;/h4&gt;
&lt;pre&gt;
&amp;lt;div ng-repeat=&amp;quot;contact in contacts&amp;quot; ng-click=&amp;quot;view(contact._id)&amp;quot;&amp;gt;
    &amp;lt;div&amp;gt;{{contact.fname}}&amp;lt;/div&amp;gt;
    &amp;lt;div&amp;gt;{{contact.lname}}&amp;lt;/div&amp;gt;
&amp;lt;/div&amp;gt;
&lt;/pre&gt;
&lt;p&gt;Here the &lt;code&gt;ng-repeat&lt;/code&gt; directive used to repeat the contacts.&lt;/p&gt;
&lt;p&gt;Onclick of each contact the &lt;code&gt;view()&lt;/code&gt; method is triggered and the routing takes place and details of the particular contact alone is displayed.&lt;/p&gt;
&lt;h4 class=&quot;code-header tltheader&quot;&gt; ListCtrl.js Controller&lt;/h4&gt;
&lt;pre&gt;
$http.get(&#39;/api&#39;).success(function(data) {
   $scope.contacts = data;
});

$scope.view = function(id) {
   $location.path(&#39;/view/&#39; + id);
};
&lt;/pre&gt;
&lt;p&gt;The &lt;code&gt;get&lt;/code&gt; service method gets all the contacts that has been added.&lt;/p&gt;
&lt;p&gt;when the &lt;code&gt;view(contact._id)&lt;/code&gt; method is clicked the view method gets the &lt;code&gt;contact._id&lt;/code&gt; parameter and that &lt;code&gt;id&lt;/code&gt; is appended to the url when the routing is taking place. The routing is done using the &lt;code&gt;$location&lt;/code&gt; service.&lt;/p&gt;
&lt;h4 class=&quot;code-header tltheader&quot;&gt; view.html&lt;/h4&gt;
&lt;pre&gt;
&amp;lt;div&amp;gt;{{contact.fname}}&amp;lt;/div&amp;gt;
&amp;lt;div&amp;gt;{{contact.lname}}&amp;lt;/div&amp;gt;
&amp;lt;button ng-click=&amp;quot;edit()&amp;quot;&amp;gt;Edit&amp;lt;/button&amp;gt;
&amp;lt;button ng-click=&amp;quot;delete()&amp;quot;&amp;gt;Delete&amp;lt;/button&amp;gt;
&lt;/pre&gt;
&lt;p&gt;Here the detail of the particular contact is displayed.&lt;/p&gt;
&lt;h4 class=&quot;code-header tltheader&quot;&gt; ViewCtrl.js Controller&lt;/h4&gt;
&lt;pre&gt;
var id = $routeParams.id;
$http.get(&#39;/api/&#39; + id).success(function(data) {
   $scope.contact = data;
});

$scope.delete = function() {
   $http.delete(&#39;/api/&#39; + id).success(function(data){
      $scope.contact = data;
      $location.path(&#39;/list&#39;);
   });
};

$scope.edit = function() {
   $location.path(&#39;/edit/&#39; + id);
}
&lt;/pre&gt;
&lt;p&gt;The &lt;code&gt;$routeParams.id&lt;/code&gt; fetches the id parameter. The &lt;code&gt;get&lt;/code&gt; service method gets the detail of the particular contact clicked. There are two buttons shown. One for editing contact and another for deleting contact. When the delete button is clicked the &lt;code&gt;delete()&lt;/code&gt; method gets triggered. The &lt;code&gt;delete&lt;/code&gt; service method deletes the particular contact. When the edit button is clicked the &lt;code&gt;edit()&lt;/code&gt; function gets triggered and it redirects to the &lt;code&gt;edit.html&lt;/code&gt; page.&lt;/p&gt;
&lt;h4 class=&quot;code-header tltheader&quot;&gt; edit.html&lt;/h4&gt;
&lt;pre&gt;
&amp;lt;input placeholder=&amp;quot;First Name&amp;quot; ng-model=&amp;quot;contact.fname&amp;quot;&amp;gt;
&amp;lt;input placeholder=&amp;quot;Last Name&amp;quot; ng-model=&amp;quot;contact.lname&amp;quot;&amp;gt;
&amp;lt;button ng-click=&amp;quot;update()&amp;quot;&amp;gt;Save&amp;lt;/button&amp;gt;
&lt;/pre&gt;
&lt;p&gt;The &lt;code&gt;edit.html&lt;/code&gt; is same as the &lt;code&gt;add.html&lt;/code&gt; page. Only difference is the input field gets filled up with the data of the particular contact so that when the changes are made and the update button is clicked the data gets updated to the database. Whereas in &lt;code&gt;add.html&lt;/code&gt; page when the save button is clicked a new contact has been added to the database.&lt;/p&gt;
&lt;h4 class=&quot;code-header tltheader&quot;&gt; EditCtrl.js Controller&lt;/h4&gt;
&lt;pre&gt;
var id = $routeParams.id;
$http.get(&#39;/api/&#39; + id).success(function(data) {
   $scope.contact = data;
});

$scope.update = function() {
   $http.put(&#39;/api/&#39; + $scope.contact._id, $scope.contact).success(function(data) {
      $scope.contact = data;
      $location.path(&#39;/list&#39;);
   });
};
&lt;/pre&gt;
&lt;p&gt;Same like before the &lt;code&gt;get&lt;/code&gt; service method gets the contact details of the particular contact using the id of the contact. The &lt;code&gt;put&lt;/code&gt; service method puts the edited contact data to the existing data in the database without creating a newer one. And on success of this it redirects to the list.html page.&lt;/p&gt;

&lt;p&gt;Now the templates and the controllers are ready, now let me define a mongoose schema.&lt;/p&gt;

&lt;h4 class=&quot;default-header tltheader&quot;&gt; Mongoose Schema&lt;/h4&gt;
&lt;h4 class=&quot;code-header tltheader&quot;&gt; model/contact.js&lt;/h4&gt;
&lt;pre&gt;
var mongoose = require(&#39;mongoose&#39;);

var contactSchema = mongoose.Schema({
   fname: String,
   lname: String
});

var Contact = mongoose.model(&#39;Contact&#39;, contactSchema);
&lt;/pre&gt;

&lt;p&gt;First, you included your model dependencies and then you used the Mongoose Schema object to create a new contactSchema.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;fname&lt;/code&gt; is a string field that represents the contacts first name. &lt;code&gt;lname&lt;/code&gt; is a string field that represents the contacts last name.&lt;/p&gt;

&lt;p&gt;In the end, you registered the &lt;code&gt;Contact&lt;/code&gt; Mongoose model to allow you to use it in the &lt;code&gt;Contact&lt;/code&gt; Express controller.&lt;/p&gt;

&lt;p&gt;Next, you&#39;ll need to make sure your application is loading the model file, so go back to the &lt;code&gt;config/mongoose.js&lt;/code&gt; file and change it as follows:&lt;/p&gt;

&lt;h4 class=&quot;code-header tltheader&quot;&gt; mongoose.js&lt;/h4&gt;
&lt;pre&gt;
var mongoose = require(&#39;mongoose&#39;),
    contactModel = require(&#39;../model/contact&#39;);

mongoose.connect(&#39;mongodb://localhost/contactdb&#39;);
&lt;/pre&gt;
&lt;p&gt;This will load your new model file and make sure your application can use your &lt;code&gt;Contact&lt;/code&gt; model. It also contains the connection of MongoDB and &lt;code&gt;contactdb&lt;/code&gt; database is been created.&lt;/p&gt;

&lt;h4 class=&quot;default-header tltheader&quot;&gt; Express Controllers and Services&lt;/h4&gt;
&lt;p&gt;Now lets start writing the express controllers and services.&lt;/p&gt;
&lt;h4 class=&quot;code-header tltheader&quot;&gt; Adding a contact&lt;/h4&gt;
&lt;pre&gt;
app.post(&#39;/api&#39;, function(req, res, next) {
   var contact = new Contact({
      fname: req.body.fname,
      lname: req.body.lname
   });
   contact.save(function(err, data) {
      if(err) {
         return next(err);
      }
      res.status(201).json(data);
   });
});
&lt;/pre&gt;

&lt;h4 class=&quot;code-header tltheader&quot;&gt; Viewing the list of contacts&lt;/h4&gt;
&lt;pre&gt;
app.get(&#39;/api&#39;, function(req, res, next) {
   Contact.find().exec(function(err, data) {
      if(err) {
         return next(err);
      }
      res.json(data);
   });
});
&lt;/pre&gt;

&lt;h4 class=&quot;code-header tltheader&quot;&gt; Viewing a particular contact&lt;/h4&gt;
&lt;pre&gt;
app.get(&#39;/api/:id&#39;, function(req, res) {
   Contact.findById(req.params.id, function(err, data){
      res.json(data);
   });
});
&lt;/pre&gt;

&lt;h4 class=&quot;code-header tltheader&quot;&gt; Updating a contact&lt;/h4&gt;
&lt;pre&gt;
app.put(&#39;/api/:id&#39;, function(req, res, next) {
   Contact.findById(req.params.id, function(err, data) {
      data.fname = req.body.fname;
      data.lname = req.body.lname;
      data.updated = Date.now();
      data.save(function(err, data) {
         if(err) {
             return next(err);
         }
         res.status(201).json(data);
      });
   });
});
&lt;/pre&gt;


&lt;h4 class=&quot;code-header tltheader&quot;&gt; Deleting a contact&lt;/h4&gt;
&lt;pre&gt;
app.delete(&#39;/api/:id&#39;, function(req, res) {
   Contact.findByIdAndRemove(req.params.id, function(err, data) {
      res.json(data);
   });
});
&lt;/pre&gt;

&lt;p&gt;That&#39;s it your done creating a simple app using MEAN stack.&lt;/p&gt;
&lt;p&gt;Fork the entire code from github and say thanks,&lt;/p&gt;
&lt;pre&gt;
https://github.com/vivinantony/PhoneBookApp
&lt;/pre&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://thelittletechie.blogspot.com/feeds/3286863161555831020/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://thelittletechie.blogspot.com/2016/04/a-simple-crud-application-using-mean.html#comment-form' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8625939250791601558/posts/default/3286863161555831020'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8625939250791601558/posts/default/3286863161555831020'/><link rel='alternate' type='text/html' href='http://thelittletechie.blogspot.com/2016/04/a-simple-crud-application-using-mean.html' title='A simple CRUD application using MEAN and mongoose'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjsH_ThaUKQNBG7LVx2DSwSBNRQnNh-U9tjND_P7Yb2uj1n0dGoDXVe3qz09fLpbzSn1niFy4eAeyF06_TP_P-GRhCQyRBLsvEnOtQaeZdmm4UqWSLorzQyTZeiE_45yDOgE6v-bWY-SNw/s72-c/A-simple-CRUD-application-using-MEAN-and-mongoose.jpg" height="72" width="72"/><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8625939250791601558.post-7214323531511590677</id><published>2016-04-13T12:05:00.000+05:30</published><updated>2017-02-05T16:39:41.756+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="all"/><category scheme="http://www.blogger.com/atom/ns#" term="Angular.js"/><title type='text'>Routing in AngularJS using UI-Router</title><content type='html'>&lt;div class=&quot;tltpost&quot;&gt;
&lt;div class=&quot;tltimg&quot;&gt;
&lt;a href=&quot;/2016/04/routing-in-angularjs-using-ui-router.html#tlt&quot;&gt;&lt;img src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg8N74NRL_y0O5_YCPGTB7zxZ7W7liIbb29pEv27dMwg_LTEqC-mNZ6yMKSzCXUf9_g8bFLGQpu5Q4KmWdTbIuy4gAom_d6z11iVqrwg8k-vkmhu3rChwbt1yNGdgXAC0NRRY3FSS0Q0Eg/s1600/Routing-in-AngularJS-using-UI-Router.jpg&quot; title=&quot;Routing in AngularJS using UI-Router&quot; alt=&quot;Routing in AngularJS using UI-Router&quot; /&gt;&lt;/a&gt;
&lt;/div&gt;

&lt;p&gt;AngularJS provides a great way to make single page applications. When creating single page applications, routing will be very important. We want our navigation to feel like a normal site and still not have our site refresh.&lt;/p&gt;

&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;

&lt;p&gt;We’ve already gone through Angular routing using the normal &lt;a href=&quot;http://www.thelittletechie.com/2016/04/routing-in-angularjs-using-angular-route.html#tlt&quot;&gt;ngRoute method&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Today we&#39;ll be looking at routing using UI-Router. Nesting route is possible in UI-Router that is a big advantage in it.&lt;/p&gt;

&lt;p&gt;The UI-Router is a routing framework for AngularJS built by the AngularUI team. It provides a different approach than ngRoute in that it changes your application views based on state of the application and not just the route URL.&lt;/p&gt;

&lt;p&gt;With this approach, your views and routes aren’t tied down to the site URL. This way, you can change the parts of your site using your routing even if the URL does not change.&lt;/p&gt;

&lt;p&gt;I have explained writing controllers, views in my &lt;a href=&quot;http://www.thelittletechie.com/2016/04/routing-in-angularjs-using-angular-route.html#tlt&quot;&gt;ngRoute post&lt;/a&gt;. It is same, only the routing and index page changes are there which i will explain you here.&lt;/p&gt;

&lt;h4 class=&quot;code-header tltheader&quot;&gt; index.html&lt;/h4&gt;
&lt;pre&gt;
&amp;lt;!DOCTYPE&amp;gt;
&amp;lt;html ng-app=&amp;quot;app&amp;quot;&amp;gt;
&amp;lt;head&amp;gt;
   &amp;lt;meta charset=&amp;quot;utf-8&amp;quot;&amp;gt;
   &amp;lt;meta http-equiv=&amp;quot;X-UA-Compatible&amp;quot; content=&amp;quot;IE=edge&amp;quot;&amp;gt;
   &amp;lt;meta name=&amp;quot;viewport&amp;quot; content=&amp;quot;width=device-width, initial-scale=1&amp;quot;&amp;gt;
   &amp;lt;title&amp;gt;AngularJS&amp;lt;/title&amp;gt;
   &amp;lt;link rel=&amp;quot;stylesheet&amp;quot; href=&amp;quot;libs/bootstrap/dist/css/bootstrap.min.css&amp;quot;&amp;gt;
   &amp;lt;link rel=&amp;quot;stylesheet&amp;quot; href=&amp;quot;style/main.css&amp;quot;&amp;gt;
&amp;lt;/head&amp;gt;
&amp;lt;body&amp;gt;
   &amp;lt;div class=&amp;quot;container&amp;quot;&amp;gt;
      &amp;lt;nav class=&amp;quot;navbar navbar-inverse&amp;quot;&amp;gt;
         &amp;lt;div class=&amp;quot;container-fluid&amp;quot;&amp;gt;
            &amp;lt;div class=&amp;quot;navbar-header&amp;quot;&amp;gt;
               &amp;lt;ul class=&amp;quot;nav navbar-nav&amp;quot;&amp;gt;
                  &amp;lt;li&amp;gt;&amp;lt;a ui-sref=&amp;quot;home&amp;quot;&amp;gt;Home&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;
                  &amp;lt;li&amp;gt;&amp;lt;a ui-sref=&amp;quot;page1&amp;quot;&amp;gt;Page 1&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;
                  &amp;lt;li&amp;gt;&amp;lt;a ui-sref=&amp;quot;page2&amp;quot;&amp;gt;Page 2&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;
               &amp;lt;/ul&amp;gt;
            &amp;lt;/div&amp;gt;
         &amp;lt;/div&amp;gt;
      &amp;lt;/nav&amp;gt;

      &amp;lt;div ui-view&amp;gt;&amp;lt;/div&amp;gt;
   &amp;lt;/div&amp;gt;

   &amp;lt;script src=&amp;quot;libs/angular/angular.min.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;
   &amp;lt;script src=&amp;quot;libs/angular-ui-router/release/angular-ui-router.min.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;
   &amp;lt;script src=&amp;quot;app.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;
   &amp;lt;script src=&amp;quot;controller/controller.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;
&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
&lt;/pre&gt;

&lt;p&gt;There’s our HTML file. We will use &lt;code&gt;Bootstrap&lt;/code&gt; to help with our styling. Notice that we also load up &lt;code&gt;ui-router&lt;/code&gt; in addition to loading Angular. UI Router is separate from the Angular core, just like ngRoute is separate.&lt;/p&gt;

&lt;p&gt;When creating a link with UI-Router, you will use &lt;code&gt;ui-sref&lt;/code&gt;. The href will be generated from this and you want this to point to a certain &lt;code&gt;state&lt;/code&gt; of your application. These are created in your &lt;code&gt;app.js&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;We also use &lt;code&gt;&amp;lt;div ui-view&amp;gt;&amp;lt;/div&amp;gt;&lt;/code&gt; instead of ngRoute&#39;s &lt;code&gt;&amp;lt;div ng-view&amp;gt;&amp;lt;/div&amp;gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Let’s start up our Angular application now in &lt;code&gt;app.js&lt;/code&gt;.&lt;/p&gt;

&lt;h4 class=&quot;code-header tltheader&quot;&gt; app.js&lt;/h4&gt;
&lt;pre&gt;
var app = angular.module(&#39;app&#39;, [&#39;ui.router&#39;]);

app.config(function($stateProvider, $urlRouterProvider) {
   $urlRouterProvider.otherwise(&#39;/&#39;);

   $stateProvider
      .state(&#39;home&#39;, {
         url: &quot;/&quot;,
         templateUrl: &quot;partials/home.html&quot;,
         controller: &quot;HomeCtrl&quot;
      })
      .state(&#39;page1&#39;, {
         url: &quot;/page1&quot;,
         templateUrl: &quot;partials/page1.html&quot;,
         controller: &quot;Page1Ctrl&quot;
      })
      .state(&#39;page2&#39;, {
         url: &quot;/page2&quot;,
         templateUrl: &quot;partials/page2.html&quot;,
         controller: &quot;Page2Ctrl&quot;
      })
});
&lt;/pre&gt;

&lt;p&gt;That&#39;s it your done.&lt;/p&gt;

&lt;a href=&quot;http://thelittletechie.github.io/RoutingUsingAngularUiRouter/&quot; class=&quot;demo-button&quot;&gt;demo&lt;/a&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://thelittletechie.blogspot.com/feeds/7214323531511590677/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://thelittletechie.blogspot.com/2016/04/routing-in-angularjs-using-ui-router.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8625939250791601558/posts/default/7214323531511590677'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8625939250791601558/posts/default/7214323531511590677'/><link rel='alternate' type='text/html' href='http://thelittletechie.blogspot.com/2016/04/routing-in-angularjs-using-ui-router.html' title='Routing in AngularJS using UI-Router'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg8N74NRL_y0O5_YCPGTB7zxZ7W7liIbb29pEv27dMwg_LTEqC-mNZ6yMKSzCXUf9_g8bFLGQpu5Q4KmWdTbIuy4gAom_d6z11iVqrwg8k-vkmhu3rChwbt1yNGdgXAC0NRRY3FSS0Q0Eg/s72-c/Routing-in-AngularJS-using-UI-Router.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8625939250791601558.post-6684574431998881510</id><published>2016-04-13T09:01:00.001+05:30</published><updated>2017-02-05T16:40:28.744+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="all"/><category scheme="http://www.blogger.com/atom/ns#" term="Angular.js"/><title type='text'>$locationProvider in angular js</title><content type='html'>&lt;div class=&quot;tltpost&quot;&gt;
&lt;div class=&quot;tltimg&quot;&gt;
&lt;a href=&quot;/2016/04/locationprovider-in-angular-js.html#tlt&quot;&gt;&lt;img src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhoNeNKlcgo1kjR3sfX9AAKZhomVsg4H-MGV0KKTmC2pzaoM0Vq3KiRiPlm9Oax3YdyDt60t5qPn7UoN1tpJS9YMa5rqV6Vwba5uhQeIshJRd4Zxl1uQ-RmXpQV_dIvsuoMmbSugxO01a8/s1600/locationProvider-in-angular-js.jpg&quot; title=&quot;$locationProvider in angular js&quot; alt=&quot;$locationProvider in angular js&quot; /&gt;&lt;/a&gt;
&lt;/div&gt;

&lt;p&gt;It is very easy to get clean URLs and remove the hashtag from the URL. It is done by configuring &lt;code&gt;$locationProvider&lt;/code&gt; and setting our &lt;code&gt;base&lt;/code&gt; for relative links.&lt;/p&gt;

&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;

&lt;p&gt;By default, AngularJS will route URLs with a hashtag. For example:&lt;/p&gt;
&lt;pre&gt;
http://website.com/
http://website.com/#/about
http://website.com/#/contact
&lt;/pre&gt;

&lt;h4 class=&quot;default-header tltheader&quot;&gt; $location Service&lt;/h4&gt;
&lt;p&gt;
In Angular, the &lt;code&gt;$location&lt;/code&gt; service parses the URL in the address bar and makes changes to your application and vice versa.
&lt;/p&gt;

&lt;h4 class=&quot;default-header tltheader&quot;&gt; $locationProvider and html5Mode&lt;/h4&gt;
&lt;p&gt;
We will use the &lt;code&gt;$locationProvider&lt;/code&gt; module and set &lt;code&gt;html5Mode&lt;/code&gt; to true.
&lt;/p&gt;

&lt;p&gt;We will do this when defining your Angular application and configuring your routes.&lt;/p&gt;
&lt;pre&gt;
var app = angular.module(&#39;app&#39;, [&#39;ngRoute&#39;]);

app.config(function($routeProvider, $locationProvider) {
   $locationProvider.html5Mode(true);
   $routeProvider
      .when(&#39;/&#39;, {
         templateUrl: &quot;partials/home.html&quot;,
         controller: &quot;HomeCtrl&quot;
        })
      .when(&#39;/page1&#39;, {
         templateUrl: &quot;partials/page1.html&quot;,
         controller: &quot;Page1Ctrl&quot;
      })
      .when(&#39;/page2&#39;, {
         templateUrl: &quot;partials/page2.html&quot;,
         controller: &quot;Page2Ctrl&quot;
      })
      .otherwise({
         redirectTo: &quot;/&quot;
      })
});
&lt;/pre&gt;

&lt;h4 class=&quot;default-header tltheader&quot;&gt; Setting For Relative Links&lt;/h4&gt;
&lt;p&gt;To link around your application using relative links, you will need to set a &lt;code&gt;&amp;lt;base&amp;gt;&lt;/code&gt; in the &lt;code&gt;&amp;lt;head&amp;gt;&lt;/code&gt; of your document.&lt;/p&gt;
&lt;pre&gt;
&amp;lt;!doctype html&amp;gt;
&amp;lt;html&amp;gt;
&amp;lt;head&amp;gt;
   &amp;lt;meta charset=&amp;quot;utf-8&amp;quot;&amp;gt;

   &amp;lt;base href=&amp;quot;/&amp;quot;&amp;gt;
&amp;lt;/head&amp;gt;
&lt;/pre&gt;

&lt;p&gt;This is a simple way to get pretty URLs and remove the hashtag in your Angular application.&lt;/p&gt;

&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://thelittletechie.blogspot.com/feeds/6684574431998881510/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://thelittletechie.blogspot.com/2016/04/locationprovider-in-angular-js.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8625939250791601558/posts/default/6684574431998881510'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8625939250791601558/posts/default/6684574431998881510'/><link rel='alternate' type='text/html' href='http://thelittletechie.blogspot.com/2016/04/locationprovider-in-angular-js.html' title='$locationProvider in angular js'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhoNeNKlcgo1kjR3sfX9AAKZhomVsg4H-MGV0KKTmC2pzaoM0Vq3KiRiPlm9Oax3YdyDt60t5qPn7UoN1tpJS9YMa5rqV6Vwba5uhQeIshJRd4Zxl1uQ-RmXpQV_dIvsuoMmbSugxO01a8/s72-c/locationProvider-in-angular-js.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8625939250791601558.post-4008160177696098159</id><published>2016-04-12T19:09:00.001+05:30</published><updated>2017-02-05T16:40:40.976+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="all"/><category scheme="http://www.blogger.com/atom/ns#" term="Angular.js"/><category scheme="http://www.blogger.com/atom/ns#" term="bootstrap"/><title type='text'>Routing in angularjs using angular-route</title><content type='html'>&lt;div class=&quot;tltpost&quot;&gt;
&lt;div class=&quot;tltimg&quot;&gt;
&lt;a href=&quot;/2016/04/routing-in-angularjs-using-angular-route.html#tlt&quot;&gt;&lt;img src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjpgizkEYzBiH98NBz5boGsQ3OTnx3o7yyfmoIpWjaqcGkF4BQuiHPwjzJR8LldPV1gZi0sQcljvp9elZ4fvb7vqQJwk5g26qWD1MZsBzA7VrZoiQxDsj4r5FmM66FmvB12oCqAvHheQmY/s1600/Routing-in-angularjs-using-angular-route.jpg&quot; title=&quot;Routing in angularjs using angular-route&quot; alt=&quot;Routing in angularjs using angular-route&quot; /&gt;&lt;/a&gt;
&lt;/div&gt;

&lt;p&gt;Single page apps are becoming increasingly popular. Sites that mimic the single page app behavior are able to provide the feel of a phone/tablet application. Angular helps to create applications like this easily.&lt;/p&gt;

&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;

&lt;p&gt;The magic of Routing is taken care by a service provider that Angular provides out of the box called &lt;code&gt;$routeProvider&lt;/code&gt; This service makes it easy to wire together controllers, view templates, and the current URL location in the browser. Using this feature we can implement deep linking. You can notice when the page route changes the page does not get refreshed. You can see this type of routing in google, gmail etc...&lt;/p&gt;

&lt;p&gt;Below is the syntax to add routing and views information to an angular application. We defined an angular app &quot;app&quot; using &lt;code&gt;angular.module&lt;/code&gt; method. Once we have our app, we can use &lt;code&gt;config()&lt;/code&gt; method to configure &lt;code&gt;$routeProvider&lt;/code&gt;. $routeProvider provides method &lt;code&gt;.when()&lt;/code&gt; and &lt;code&gt;.otherwise()&lt;/code&gt; which we can use to define the routing for our app.&lt;/p&gt;

&lt;h4 class=&quot;code-header tltheader&quot;&gt; app.js&lt;/h4&gt;
&lt;pre&gt;
var app = angular.module(&#39;app&#39;, [&#39;ngRoute&#39;]);

app.config(function($routeProvider) {
   $routeProvider
      .when(&#39;/&#39;, {
         templateUrl: &quot;partials/home.html&quot;,
         controller: &quot;HomeCtrl&quot;
        })
      .when(&#39;/page1&#39;, {
         templateUrl: &quot;partials/page1.html&quot;,
         controller: &quot;Page1Ctrl&quot;
      })
      .when(&#39;/page2&#39;, {
         templateUrl: &quot;partials/page2.html&quot;,
         controller: &quot;Page2Ctrl&quot;
      })
      .otherwise({
         redirectTo: &quot;/&quot;
      })
});
&lt;/pre&gt;

&lt;p&gt;In above code we defined three urls &lt;code&gt;/&lt;/code&gt;, &lt;code&gt;/page1&lt;/code&gt; and &lt;code&gt;/page2&lt;/code&gt; and mapped them with views &lt;code&gt;partials/home.html&lt;/code&gt;, &lt;code&gt;partials/page1.html&lt;/code&gt; and &lt;code&gt;partials/page2.html&lt;/code&gt; respectively. When we open &lt;code&gt;http://localhost/#/page1&lt;/code&gt; url in browser, Angular automatically matches it with the route we configured and load &lt;code&gt;page1.html&lt;/code&gt; template. It then invokes &lt;code&gt;Page1Ctrl&lt;/code&gt; where we can add logic for our view.&lt;/p&gt;

&lt;p&gt;Notice how we used otherwise() method to define a default route. In case routeProvider does not match with any url, it redirects to default route.&lt;/p&gt;

&lt;p&gt;Below &lt;code&gt;index.html&lt;/code&gt; file is the main html file. It includes AngularJS library and define structure for our app. We have three links: Home, Page 1 and Page 2. Each link loads template inside &lt;code&gt;ng-view&lt;/code&gt; directive. This becomes the placeholder for views. Each view referred by the route is loaded in this section of document. I am using bootstrap here.&lt;/p&gt;

&lt;h4 class=&quot;code-header tltheader&quot;&gt; index.html&lt;/h4&gt;
&lt;pre&gt;
&amp;lt;!DOCTYPE&amp;gt;
&amp;lt;html ng-app=&amp;quot;app&amp;quot;&amp;gt;
&amp;lt;head&amp;gt;
   &amp;lt;meta charset=&amp;quot;utf-8&amp;quot;&amp;gt;
   &amp;lt;meta http-equiv=&amp;quot;X-UA-Compatible&amp;quot; content=&amp;quot;IE=edge&amp;quot;&amp;gt;
   &amp;lt;meta name=&amp;quot;viewport&amp;quot; content=&amp;quot;width=device-width, initial-scale=1&amp;quot;&amp;gt;
   &amp;lt;title&amp;gt;AngularJS&amp;lt;/title&amp;gt;
   &amp;lt;link rel=&amp;quot;stylesheet&amp;quot; href=&amp;quot;libs/bootstrap/dist/css/bootstrap.min.css&amp;quot;&amp;gt;
&amp;lt;/head&amp;gt;
&amp;lt;body&amp;gt;
   &amp;lt;div class=&amp;quot;container&amp;quot;&amp;gt;
      &amp;lt;nav class=&amp;quot;navbar navbar-inverse&amp;quot;&amp;gt;
         &amp;lt;div class=&amp;quot;container-fluid&amp;quot;&amp;gt;
            &amp;lt;div class=&amp;quot;navbar-header&amp;quot;&amp;gt;
               &amp;lt;ul class=&amp;quot;nav navbar-nav&amp;quot;&amp;gt;
                  &amp;lt;li&amp;gt;&amp;lt;a href=&amp;quot;#/&amp;quot;&amp;gt;Home&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;
                  &amp;lt;li&amp;gt;&amp;lt;a href=&amp;quot;#/page1&amp;quot;&amp;gt;Page 1&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;
                  &amp;lt;li&amp;gt;&amp;lt;a href=&amp;quot;#/page2&amp;quot;&amp;gt;Page 2&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;
               &amp;lt;/ul&amp;gt;
            &amp;lt;/div&amp;gt;
         &amp;lt;/div&amp;gt;
      &amp;lt;/nav&amp;gt;

      &amp;lt;div ng-view&amp;gt;&amp;lt;/div&amp;gt;
   &amp;lt;/div&amp;gt;

   &amp;lt;script src=&amp;quot;libs/angular/angular.min.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;
   &amp;lt;script src=&amp;quot;libs/angular-route/angular-route.min.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;
   &amp;lt;script src=&amp;quot;app.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;
   &amp;lt;script src=&amp;quot;controller/controller.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;
&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
&lt;/pre&gt;

&lt;p&gt;I have added an external &lt;code&gt;angular-route.js&lt;/code&gt;. This is not necessary for the older versions of angular say &lt;code&gt;1.0.8&lt;/code&gt;. In newer version say &lt;code&gt;1.5.3&lt;/code&gt; which i am using here we require the external angular-route.js or we get error in console &lt;code&gt;Uncaught Error: [$injector:modulerr]&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Now the main html is over, lets write the controller page which i have written separately.&lt;/p&gt;

&lt;h4 class=&quot;code-header tltheader&quot;&gt; controller.js&lt;/h4&gt;
&lt;pre&gt;
var app = angular.module(&#39;app&#39;);
app.controller(&#39;HomeCtrl&#39;, function($scope) {
   $scope.title = &quot;Home Page&quot;;
});

app.controller(&#39;Page1Ctrl&#39;, function($scope) {
   $scope.title = &quot;Page 1&quot;;
});

app.controller(&#39;Page2Ctrl&#39;, function($scope) {
   $scope.title = &quot;Page 2&quot;;
});
&lt;/pre&gt;

&lt;p&gt;The controllers for each page home.html, page1.html and page2.html is written.&lt;/p&gt;

&lt;p&gt;I kept the contents minimal as i gave importance to routing alone. &lt;/p&gt;

&lt;h4 class=&quot;code-header tltheader&quot;&gt; partials&lt;/h4&gt;
&lt;pre&gt;
&amp;lt;div class=&amp;quot;jumbotron&amp;quot;&amp;gt;
   &amp;lt;h2&amp;gt;{{title}}&amp;lt;/h2&amp;gt;
&amp;lt;/div&amp;gt;
&lt;/pre&gt;

&lt;a href=&quot;http://thelittletechie.github.io/RoutingUsingAngularRoute/&quot; class=&quot;demo-button&quot;&gt;demo&lt;/a&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://thelittletechie.blogspot.com/feeds/4008160177696098159/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://thelittletechie.blogspot.com/2016/04/routing-in-angularjs-using-angular-route.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8625939250791601558/posts/default/4008160177696098159'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8625939250791601558/posts/default/4008160177696098159'/><link rel='alternate' type='text/html' href='http://thelittletechie.blogspot.com/2016/04/routing-in-angularjs-using-angular-route.html' title='Routing in angularjs using angular-route'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjpgizkEYzBiH98NBz5boGsQ3OTnx3o7yyfmoIpWjaqcGkF4BQuiHPwjzJR8LldPV1gZi0sQcljvp9elZ4fvb7vqQJwk5g26qWD1MZsBzA7VrZoiQxDsj4r5FmM66FmvB12oCqAvHheQmY/s72-c/Routing-in-angularjs-using-angular-route.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8625939250791601558.post-5944596538209522848</id><published>2016-03-30T12:40:00.004+05:30</published><updated>2016-03-30T22:19:47.014+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="all"/><category scheme="http://www.blogger.com/atom/ns#" term="bower"/><title type='text'>How to install bower on windows?</title><content type='html'>&lt;div class=&quot;tltpost&quot;&gt;
&lt;div class=&quot;tltimg&quot;&gt;
&lt;a href=&quot;/2016/03/how-to-install-bower-on-windows.html#tlt&quot;&gt;&lt;img src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj64Yu2CThXWwg-FgSeiNt4hT5vY15zEDqNuV2_HQ7rs3jaSn0zXd0SRlG0Gnb1vpZablz5u_4aEcSbdhbHOdbfADadfjsa8iwn6eXg5XRWZQ2d6MOlDdB3jHxgJpbIUBHy0lkphD0DbME/s1600/How-to-install-bower-on-windows.jpg&quot; title=&quot;How to install bower on windows?&quot; alt=&quot;How to install bower on windows?&quot; /&gt;&lt;/a&gt;
&lt;/div&gt;

&lt;p&gt;In this blog post you are going to learn how to get up and running with Bower. You’ll start by installing the Bower command-line utility and then go on to learn about the various commands that are available for managing packages.&lt;/p&gt;

&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;

&lt;h4 class=&quot;default-header tltheader&quot;&gt; Installing Bower&lt;/h4&gt;
&lt;p&gt;
Bower can be installed using npm, the Node package manager. If you don’t already have npm installed, head over to the &lt;a href=&quot;http://nodejs.org/&quot; target=&quot;_blank&quot;&gt;Node.js&lt;/a&gt; website and download the relevant copy of Node.js for your system. The npm program is included with the install of Node.js.
&lt;/p&gt;
&lt;p&gt;You can see here how you can install node.js in detail. &lt;a href=&quot;/2016/03/how-to-install-nodejs-and-npm-on-windows.html#tlt&quot;&gt;Click here!&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Once you have npm installed, open up Terminal (or Command Prompt) and enter the following command:&lt;/p&gt;
&lt;pre&gt;
npm install -g bower
&lt;/pre&gt;
&lt;p&gt;This will install Bower globally on your system.&lt;/p&gt;
&lt;p&gt;Now that you have Bower installed, we can start looking at the commands that are used to manage packages.&lt;/p&gt;

&lt;h4 class=&quot;default-header tltheader&quot;&gt; Finding Packages&lt;/h4&gt;
&lt;p&gt;
To search for packages on the command line you use the &lt;code&gt;search&lt;/code&gt; command. This should be followed by your search query.
&lt;/p&gt;
&lt;pre&gt;
bower search &amp;lt;query&amp;gt;
&lt;/pre&gt;

&lt;p&gt;
For example to search for packages that contain the word ‘jquery’ you could do the following:
&lt;/p&gt;
&lt;pre&gt;
bower search jquery
&lt;/pre&gt;

&lt;p&gt;This command would return a whole bunch of results, some of which are displayed in the snippet below.&lt;/p&gt;
&lt;pre&gt;
jquery git://github.com/components/jquery.git
jquery-ui git://github.com/components/jqueryui
jquery.cookie git://github.com/carhartl/jquery-cookie.git
jquery-placeholder git://github.com/mathiasbynens/jquery-placeholder.git
jquery-file-upload git://github.com/blueimp/jQuery-File-Upload.git
jasmine-jquery git://github.com/velesin/jasmine-jquery
jquery.ui git://github.com/jquery/jquery-ui.git
...
&lt;/pre&gt;
&lt;p&gt;Each result displays the name of the package and a Git endpoint. You will need either the name or Git endpoint to install a package.&lt;/p&gt;

&lt;h4 class=&quot;default-header tltheader&quot;&gt; Installing Packages&lt;/h4&gt;
&lt;p&gt;To add a new Bower package to your project you use the &lt;code&gt;install&lt;/code&gt; command. This should be passed the name of the package you wish to install.&lt;/p&gt;
&lt;pre&gt;
bower install &amp;lt;package&amp;gt;
&lt;/pre&gt;
&lt;p&gt;As well as using the package name, you can also install a package by specifying one of the following:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;A Git endpoint such as &lt;code&gt;git://github.com/components/jquery.git&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;A path to a local Git repository.&lt;/li&gt;
&lt;li&gt;A shorthand endpoint like &lt;code&gt;components/jquery&lt;/code&gt;. Bower will assume that GitHub is being used, in which case, the endpoint is the part after &lt;code&gt;github.com&lt;/code&gt; in the repository URL.&lt;/li&gt;
&lt;li&gt;A URL to a &lt;code&gt;zip&lt;/code&gt; or &lt;code&gt;tar&lt;/code&gt; file. The files contents will be extracted automatically.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;You can install a specific version of the package by adding a pound-sign (#) after the package name, followed by the version number.&lt;/p&gt;
&lt;pre&gt;
bower install &amp;lt;package&amp;gt;#&amp;lt;version&amp;gt;
&lt;/pre&gt;

&lt;p&gt;Installed packages will be placed in a &lt;code&gt;bower_components&lt;/code&gt; directory. This is created in the folder which the bower program was executed. You can change this destination using the &lt;a href=&quot;/2016/02/change-bowerss-default-components-folder.html#tlt&quot;&gt;configuration options&lt;/a&gt; in a .bowerrc file.&lt;/p&gt;
&lt;p&gt;
Once installed, you can use a package by simply adding a &lt;code&gt;&amp;lt;script&amp;gt;&lt;/code&gt; or &lt;code&gt;&amp;lt;link&amp;gt;&lt;/code&gt; tag to your HTML markup. Although Bower packages most commonly contain JavaScript files, they can also contain CSS or even images.
&lt;/p&gt;
&lt;pre&gt;
&amp;lt;script src=&amp;quot;path/to/bower_components/jquery/jquery.min.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;
&lt;/pre&gt;

&lt;h4 class=&quot;default-header tltheader&quot;&gt; Listing Installed Packages&lt;/h4&gt;
&lt;p&gt;You can easily find out which packages are installed using the &lt;code&gt;list&lt;/code&gt; command.&lt;/p&gt;
&lt;pre&gt;
bower list
&lt;/pre&gt;


&lt;h4 class=&quot;default-header tltheader&quot;&gt; Updating Packages&lt;/h4&gt;
&lt;p&gt;Updating a package is pretty straightforward. If you’ve used a bower.json file you can execute a simple &lt;code&gt;update&lt;/code&gt; command to update all of the packages at once. However, the update tool will abide by the version restrictions you’ve specified in the bower.json file.&lt;/p&gt;
&lt;pre&gt;
bower update
&lt;/pre&gt;
&lt;p&gt;To update an individual package you again use the &lt;code&gt;update&lt;/code&gt; command, this time specifying the name of the package you wish to update.&lt;/p&gt;
&lt;pre&gt;
bower update &amp;lt;package&amp;gt;
&lt;/pre&gt;

&lt;h4 class=&quot;default-header tltheader&quot;&gt; Uninstalling Packages&lt;/h4&gt;
&lt;p&gt;To remove a package you can use the &lt;code&gt;uninstall&lt;/code&gt; command followed by the name of the package you wish to remove.&lt;/p&gt;
&lt;pre&gt;
bower uninstall &amp;lt;package&amp;gt;
&lt;/pre&gt;
&lt;p&gt;
It’s possible to remove multiple packages at once by listing the package names.
&lt;/p&gt;
&lt;pre&gt;
bower uninstall jquery modernizr sass-bootstrap
&lt;/pre&gt;

&lt;p&gt;Source: http://blog.teamtreehouse.com/getting-started-bower&lt;/p&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://thelittletechie.blogspot.com/feeds/5944596538209522848/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://thelittletechie.blogspot.com/2016/03/how-to-install-bower-on-windows.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8625939250791601558/posts/default/5944596538209522848'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8625939250791601558/posts/default/5944596538209522848'/><link rel='alternate' type='text/html' href='http://thelittletechie.blogspot.com/2016/03/how-to-install-bower-on-windows.html' title='How to install bower on windows?'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj64Yu2CThXWwg-FgSeiNt4hT5vY15zEDqNuV2_HQ7rs3jaSn0zXd0SRlG0Gnb1vpZablz5u_4aEcSbdhbHOdbfADadfjsa8iwn6eXg5XRWZQ2d6MOlDdB3jHxgJpbIUBHy0lkphD0DbME/s72-c/How-to-install-bower-on-windows.jpg" height="72" width="72"/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8625939250791601558.post-8143369938609264110</id><published>2016-03-25T11:19:00.002+05:30</published><updated>2016-03-25T11:24:04.817+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="all"/><category scheme="http://www.blogger.com/atom/ns#" term="Angular.js"/><title type='text'>Remove space in text field using angular.js</title><content type='html'>&lt;div class=&quot;tltpost&quot;&gt;

&lt;p&gt;Removing space in text field using Angular.js is easy. We can do this by &lt;code&gt;ng-change&lt;/code&gt; attribute.&lt;/p&gt;

&lt;p&gt;I will show you how to do this in two different ways.&lt;/p&gt;

&lt;h4 class=&quot;default-header tltheader&quot;&gt; Way 1&lt;/h4&gt;
&lt;p&gt;Put &lt;code&gt;ng-change&lt;/code&gt; attribute to the input field to which you want to the remove white-space.&lt;/p&gt;
&lt;p&gt;Say if the &lt;code&gt;ng-model&lt;/code&gt; is &lt;code&gt;contact.name&lt;/code&gt;, then &lt;code&gt;ng-change&lt;/code&gt; would be &lt;code&gt;contact.name = contact.name.split(&#39; &#39;).join(&#39;&#39;)&lt;/code&gt;&lt;/p&gt;

&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;

&lt;h4 class=&quot;code-header tltheader&quot;&gt; HTML&lt;/h4&gt;
&lt;pre&gt;
&amp;lt;input type=&amp;quot;text&amp;quot; ng-model=&amp;quot;contact.name&amp;quot; ng-change=&amp;quot;contact.name = contact.name.split(&#39; &#39;).join(&#39;&#39;)&amp;quot; /&amp;gt;
&lt;/pre&gt;

&lt;p&gt;Here it splits the white space and joins it. It&#39;s simple right.&lt;/p&gt;

&lt;h4 class=&quot;default-header tltheader&quot;&gt; Way 2&lt;/h4&gt;
&lt;p&gt;In this, instead of adding values of &lt;code&gt;ng-change&lt;/code&gt; directly to the input we will define it through a function.&lt;/p&gt;

&lt;h4 class=&quot;code-header tltheader&quot;&gt; HTML&lt;/h4&gt;
&lt;pre&gt;
&amp;lt;input type=&amp;quot;text&amp;quot; ng-model=&amp;quot;contact.name&amp;quot; ng-change=&amp;quot;noSpace()&amp;quot; /&amp;gt;
&lt;/pre&gt;

&lt;h4 class=&quot;code-header tltheader&quot;&gt; Angular&lt;/h4&gt;
&lt;pre&gt;
$scope.noSpace = function() {
   $scope.contact.name = $scope.contact.name.split(&#39; &#39;).join(&#39;&#39;);
};
&lt;/pre&gt;

&lt;h4 class=&quot;note-header tltheader&quot;&gt; Note:&lt;/h4&gt;
&lt;p&gt;&lt;em&gt;As your using angular don&#39;t forget to import angular.js file.&lt;/em&gt;&lt;/p&gt;

&lt;a href=&quot;http://codepen.io/vivinantony/debug/EKXYLP&quot; class=&quot;demo-button&quot;&gt;demo&lt;/a&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://thelittletechie.blogspot.com/feeds/8143369938609264110/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://thelittletechie.blogspot.com/2016/03/remove-space-in-text-field-using.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8625939250791601558/posts/default/8143369938609264110'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8625939250791601558/posts/default/8143369938609264110'/><link rel='alternate' type='text/html' href='http://thelittletechie.blogspot.com/2016/03/remove-space-in-text-field-using.html' title='Remove space in text field using angular.js'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8625939250791601558.post-7685739053451166682</id><published>2016-03-24T14:02:00.000+05:30</published><updated>2016-03-30T22:19:59.582+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="all"/><category scheme="http://www.blogger.com/atom/ns#" term="Node.js"/><title type='text'>How to install Node.js and NPM on windows?</title><content type='html'>&lt;div class=&quot;tltpost&quot;&gt;
&lt;div class=&quot;tltimg&quot;&gt;
&lt;a href=&quot;/2016/03/how-to-install-nodejs-and-npm-on-windows.html#tlt&quot;&gt;&lt;img src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjVQpmTCaiwhbBj4GDB111OJdMvO8DMgYXNFNX5q-9CbFLCUTafcrCDB3wp9B-j2qdHsoa6rDCOVyXL7CAGtC5xRDtySlIA1bVa7xq3V9xMxOV6rkAsfOdf0ErXPBt2mL4OLM63kWfINQ8/s1600/How-to-install-Node.js-and-NPM-on-windows.jpg&quot; title=&quot;How to install Node.js and NPM on windows?&quot; alt=&quot;How to install Node.js and NPM on windows?&quot; /&gt;&lt;/a&gt;
&lt;/div&gt;

&lt;p&gt;JavaScript is quickly becoming the go-to language for web developers. Front-end web developers use JavaScript to add user interface enhancements, add interactivity, and talk to back-end web services using AJAX. Web developers who work on the server-side are also flocking to JavaScript because of the efficiency and speed offered by JavaScript’s event-driven, non-blocking nature.&lt;/p&gt;

&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;

&lt;p&gt;In fact, concentrating on JavaScript as your language of choice offers the opportunity to master a single language while still being able to develop “full-stack” web applications. The key to this server-side JavaScript revolution is Node.js® — a version of Chrome’s V8 JavaScript run-time engine — which makes it possible to run JavaScript on the server-side.&lt;/p&gt;

&lt;p&gt;Node.js is also used for developing desktop applications and for deploying tools that make developing web sites simpler. For example, by installing Node.js on your desktop machine, you can quickly convert CoffeeScript to JavaScript, SASS to CSS, and shrink the size of your HTML, JavaScript and graphic files. Using NPM — a tool that makes installing and managing Node modules — it’s quite easy to add many useful tools to your web development toolkit.&lt;/p&gt;

&lt;p&gt;Node isn’t a program that you simply launch like Word or Photoshop: you won’t find it pinned to the taskbar or in your list of Apps. To use Node you must type command-line instructions, so you need to be comfortable with (or at least know how to start) a command-line tool like the Windows Command Prompt.&lt;/p&gt;

&lt;p&gt;Installing Node and NPM is pretty straightforward using the installer package available from the Node.js web site.&lt;/p&gt;

&lt;h4 class=&quot;default-header tltheader&quot;&gt; Steps to Install:&lt;/h4&gt;
&lt;ul&gt;
 &lt;li&gt;Download the Windows installer from the &lt;a href=&quot;http://nodejs.org/&quot; target=&quot;_blank&quot;&gt;Nodes.js&lt;/a&gt; web site.&lt;/li&gt;
 &lt;li&gt;Run the installer (the .msi file you downloaded in the previous step.)&lt;/li&gt;
 &lt;li&gt;Follow the prompts in the installer (Accept the license agreement, click the NEXT button a bunch of times and accept the default installation settings).&lt;/li&gt;
 &lt;li&gt;Restart your computer. You won’t be able to run Node.js® until you restart your computer.&lt;/li&gt;
 &lt;li&gt;Thats it your done! Now we will test whether it is working fine.&lt;/li&gt;
&lt;/ul&gt;

&lt;h4 class=&quot;default-header tltheader&quot;&gt; Testing:&lt;/h4&gt;
&lt;ul&gt;
 &lt;li&gt;To see if Node is installed, open the Windows Command Prompt, Powershell or a similar command line tool, and type &lt;code&gt;node -v&lt;/code&gt;. This should print a version number, so you’ll see something like this v0.10.35.&lt;/li&gt;
 &lt;li&gt;To see if NPM is installed, type &lt;code&gt;npm -v&lt;/code&gt; in Terminal. This should print NPM’s version number so you’ll see something like this 1.4.28&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;Source: http://blog.teamtreehouse.com/install-node-js-npm-windows&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://thelittletechie.blogspot.com/feeds/7685739053451166682/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://thelittletechie.blogspot.com/2016/03/how-to-install-nodejs-and-npm-on-windows.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8625939250791601558/posts/default/7685739053451166682'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8625939250791601558/posts/default/7685739053451166682'/><link rel='alternate' type='text/html' href='http://thelittletechie.blogspot.com/2016/03/how-to-install-nodejs-and-npm-on-windows.html' title='How to install Node.js and NPM on windows?'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjVQpmTCaiwhbBj4GDB111OJdMvO8DMgYXNFNX5q-9CbFLCUTafcrCDB3wp9B-j2qdHsoa6rDCOVyXL7CAGtC5xRDtySlIA1bVa7xq3V9xMxOV6rkAsfOdf0ErXPBt2mL4OLM63kWfINQ8/s72-c/How-to-install-Node.js-and-NPM-on-windows.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8625939250791601558.post-4819723603436235001</id><published>2016-02-28T23:58:00.001+05:30</published><updated>2016-02-28T23:59:32.682+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="all"/><category scheme="http://www.blogger.com/atom/ns#" term="info"/><title type='text'>Change bowers&#39;s default components folder</title><content type='html'>&lt;div class=&quot;tltpost&quot;&gt;

&lt;p&gt;When you do a bower install the components gets saved to bower_components folder by default. If you want to change the directory of the installation create a bower configuration file and mention the path were you need it to be installed.&lt;/p&gt;

&lt;p&gt;For example,&lt;/p&gt;

&lt;pre&gt;
{
  &quot;directory&quot; : &quot;public/vendor&quot;
}
&lt;/pre&gt;

&lt;p&gt;As you mentioned the directory the components will be installed to vendor folder inside public folder of your project.&lt;/p&gt;

&lt;p&gt;Save this file as &lt;code&gt;.bowerrc&lt;/code&gt;. That&#39;s it. When you do a bower install now the components get saved to the specified directory.&lt;/p&gt;

&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://thelittletechie.blogspot.com/feeds/4819723603436235001/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://thelittletechie.blogspot.com/2016/02/change-bowerss-default-components-folder.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8625939250791601558/posts/default/4819723603436235001'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8625939250791601558/posts/default/4819723603436235001'/><link rel='alternate' type='text/html' href='http://thelittletechie.blogspot.com/2016/02/change-bowerss-default-components-folder.html' title='Change bowers&#39;s default components folder'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8625939250791601558.post-7568998812238568379</id><published>2016-02-13T10:02:00.000+05:30</published><updated>2017-02-05T16:41:19.599+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="all"/><category scheme="http://www.blogger.com/atom/ns#" term="css3"/><category scheme="http://www.blogger.com/atom/ns#" term="html"/><category scheme="http://www.blogger.com/atom/ns#" term="jquery"/><title type='text'>Be my valentine?</title><content type='html'>&lt;div class=&quot;tltpost&quot;&gt;
&lt;div class=&quot;tltimg&quot;&gt;
&lt;a href=&quot;/2016/02/be-my-valentine.html#tlt&quot;&gt;&lt;img src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgLuFjx54hqda9aTJaWIGpCfZM9S9KtDoEFM7KGf8VGQ-D-aUgAw0xaLW-8v5fL9ZGeZhspRqcyT_VpEH6U-mDwJqUCAa32WYiAOGRzGwMR80XRb1IzNF3t6kbtO7QtqvZiVByzOf52Iok/s1600/Be-my-valentine.jpg&quot; title=&quot;Be my valentine?&quot; alt=&quot;Be my valentine?&quot; /&gt;&lt;/a&gt;
&lt;/div&gt;

&lt;p&gt;Why don&#39;t you show some love to your valentine in a different way? Open your heart with a special message for your loved one. CSS3 animations make it beat and after clicking a message is shown.&lt;/p&gt;

&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;

&lt;h4 class=&quot;code-header tltheader&quot;&gt; HTML&lt;/h4&gt;
&lt;pre&gt;
&amp;lt;div class=&amp;quot;bgoverlay&amp;quot;&amp;gt;
  &amp;lt;div class=&amp;quot;container&amp;quot;&amp;gt;
    &amp;lt;span class=&amp;quot;ico&amp;quot;&amp;gt;
      &amp;lt;span class=&amp;quot;ico2&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;
      &amp;lt;span class=&amp;quot;title&amp;quot;&amp;gt;Click Me&amp;lt;/span&amp;gt;
    &amp;lt;/span&amp;gt;
    &amp;lt;div class=&amp;quot;endtext&amp;quot;&amp;gt;
      &amp;lt;span class=&amp;quot;close&amp;quot; title=&amp;quot;Restart&amp;quot;&amp;gt;&amp;lt;i class=&amp;quot;fa fa-times&amp;quot;&amp;gt;&amp;lt;/i&amp;gt;&amp;lt;/span&amp;gt;  
      &amp;lt;h1&amp;gt;I love you baby&amp;lt;/h1&amp;gt;
      &amp;lt;h2&amp;gt;Be my valentine?&amp;lt;/h2&amp;gt;
      &amp;lt;h3&amp;gt;- Vivin&amp;lt;/h3&amp;gt;
    &amp;lt;/div&amp;gt;
  &amp;lt;/div&amp;gt;
&amp;lt;/div&amp;gt;
&lt;/pre&gt;

&lt;h4 class=&quot;code-header tltheader&quot;&gt; CSS&lt;/h4&gt;
&lt;pre&gt;
@import url(http://fonts.googleapis.com/css?family=Pacifico);
body{
  background: url(http://subtlepatterns.com/patterns/noise_lines.png);
  font-family: &#39;Pacifico&#39;, cursive;
  overflow: hidden;
  color: #fff;
}
.bgoverlay{
  background: rgb(103,58,183);
  background: rgba(103,58,183,0.7);
  position: absolute;
  top:0;
  left:0;
  right:0;
  bottom:0;
}
.container{
  position: relative;
  margin: 120px auto 0 auto;
  width: 320px;
}


.ico{
  display: block;
  width: 320px;
  height: 320px;
}
.open .ico{
  animation: open 4s;
  transform: scale(10);
}
.ico .title{
  position: absolute;
  top: 50%;
  left: 50%;
  margin-left: -95px;
  margin-top: -73px;
  z-index: 4;
  font-size: 50px;
  font-family: &#39;Pacifico&#39;, cursive;
  color: #fff;
  cursor: pointer;
  text-shadow: 2px 4px 3px rgba(0,0,0,0.3);
}
.open .ico .title{
  opacity: 0;
  transition: all 0.3s ease;
  top:-100px;
}
.ico:before,
.ico:after,
.ico2:before,
.ico2:after{
  position: absolute;
  top:0;
  left:0;
}
.ico:before,
.ico:after,
.ico2:before,
.ico2:after{
  display: block;
  font-size: 20em;
  color: #ff4081;
  content: &quot;\f004&quot;;
  font-family: FontAwesome;
  text-rendering: auto;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
.ico2:before,
.ico2:after{
  color: #e91e63;
}
.ico:before{
  z-index: 3;
}
.ico:after{
  animation: explode 4s infinite;
}


.ico2:before{
  animation: explodeSmall 3s infinite;
}
.ico2:after{
  animation: explodeSmall 2s infinite;
}


.endtext{
  opacity:0;
  position: absolute;
  top:-100px;
  width:100%;
}
.open .endtext{
  top:0;
  opacity: 1;
  animation: show 5s;
}
.endtext .close{
  position: absolute;
  top: 0;
  right: 0;
  cursor: pointer;
  text-shadow: 2px 4px 3px rgba(0,0,0,0.3);
}
.endtext h1,
.endtext h2,
.endtext h3{
  text-shadow: 2px 4px 3px rgba(0,0,0,0.3);
  text-align: center;
  font-weight: normal;
}
.endtext h1{
  font-size: 50px;
}
.endtext h2{
  font-size: 30px;
}
.endtext h3{
  font-size: 20px;
}


@keyframes explode {
    from {
      transform: scale(1);
      opacity: 1;
    }
    to {
      transform: scale(1.6);
      opacity: 0;
    }
}
@keyframes explodeSmall {
    from {
      transform: scale(1);
      opacity: 1;
    }
    to {
      transform: scale(1.2);
      opacity: 0;
    }
}


@keyframes open {
    from {
      transform: scale(1);
    }
    to {
      transform: scale(10);
    }
}

@keyframes show {
    from {
      opacity: 0;
      top: -100px;
    }
    to {
      opacity: 1;
      top:0;
    }
}
&lt;/pre&gt;

&lt;h4 class=&quot;code-header tltheader&quot;&gt; jQuery&lt;/h4&gt;
&lt;pre&gt;
$(document).ready(function(){
  $(&#39;.title&#39;).click(function(){
    $(&#39;.container&#39;).addClass(&#39;open&#39;);
  });
  
  
  $(&#39;.close&#39;).click(function(){
    $(&#39;.container&#39;).removeClass(&#39;open&#39;);
  });
});
&lt;/pre&gt;


&lt;h4 class=&quot;attachment-header tltheader&quot;&gt; Attachments:&lt;/h4&gt;
&lt;p&gt;I have used external attachments.&lt;/p&gt;
&lt;pre&gt;
https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.5.0/css/font-awesome.min.css
&lt;/pre&gt;

&lt;p&gt;You can add some images and your content too if required and impress your valentine. Why just looking? Start sharing.&lt;/p&gt;

&lt;a href=&quot;http://codepen.io/vivinantony/debug/wMNrbO&quot; class=&quot;demo-button&quot;&gt;demo&lt;/a&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://thelittletechie.blogspot.com/feeds/7568998812238568379/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://thelittletechie.blogspot.com/2016/02/be-my-valentine.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8625939250791601558/posts/default/7568998812238568379'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8625939250791601558/posts/default/7568998812238568379'/><link rel='alternate' type='text/html' href='http://thelittletechie.blogspot.com/2016/02/be-my-valentine.html' title='Be my valentine?'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgLuFjx54hqda9aTJaWIGpCfZM9S9KtDoEFM7KGf8VGQ-D-aUgAw0xaLW-8v5fL9ZGeZhspRqcyT_VpEH6U-mDwJqUCAa32WYiAOGRzGwMR80XRb1IzNF3t6kbtO7QtqvZiVByzOf52Iok/s72-c/Be-my-valentine.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8625939250791601558.post-6377656284368864765</id><published>2015-12-08T13:03:00.001+05:30</published><updated>2017-02-05T16:42:24.336+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="all"/><category scheme="http://www.blogger.com/atom/ns#" term="html"/><category scheme="http://www.blogger.com/atom/ns#" term="javascript"/><title type='text'>Simple slider without any framework</title><content type='html'>&lt;div class=&quot;tltpost&quot;&gt;
&lt;div class=&quot;tltimg&quot;&gt;
&lt;a href=&quot;/2015/12/simple-slider-without-any-framework.html#tlt&quot;&gt;&lt;img src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhChN7gOw9Bv9o4QHea5sO2Ufc4kCzywNR5SSVPSzc8n5P5HII7Ro-_dVmxknDk6d9JqIBcUG6PiUhSxUBaTjY8LaOul9AB9Jr1vexiZXTZGDx38f4Iq0nbQN1Af4VvD0TujD-Uu2WC0jQ/s1600/Simple-slider-without-any-framework.jpg&quot; title=&quot;Simple slider without any framework&quot; alt=&quot;Simple slider without any framework&quot; /&gt;&lt;/a&gt;
&lt;/div&gt;

&lt;p&gt;A simple slider without using any framework. It is done using pure javascript. Easy to create when you learn it, later you will not search for any sliders. You will love to write your own slider.
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;

&lt;p&gt;First we will setup a default image which will load on page load.&lt;/p&gt;
&lt;pre&gt;
&amp;lt;img src=&amp;quot;image url here&amp;quot; name=&amp;quot;slideshow&amp;quot; /&amp;gt;
&lt;/pre&gt;

&lt;p&gt;Now lets give two links for previous and next image change. This can be done by couple of different ways.&lt;/p&gt;
&lt;p&gt;One way is to add the function to onclick. Here&#39;s how it is done.&lt;/p&gt;
&lt;pre&gt;
 &amp;lt;a href=&amp;quot;&amp;quot; onclick=&amp;quot;return functionName()&amp;quot;&amp;gt;&amp;lt;/a&amp;gt;
&lt;/pre&gt;

&lt;p&gt;Another way to do is by adding the function to href like this.&lt;/p&gt;
&lt;pre&gt;
 &amp;lt;a href=&amp;quot;javascript:functionName()&amp;quot;&amp;gt;&amp;lt;/a&amp;gt;
&lt;/pre&gt;

&lt;p&gt;I have taken up one way and written for previous and next links.&lt;/p&gt;
&lt;p&gt;The function i am going to call is changeImage with -1 as the parameter. The user will click on the link, it will run the function changeImage. The -1 is going to change the image to previous image as all the images are stored in an array.&lt;/p&gt;
&lt;pre&gt;
&amp;lt;a href=&amp;quot;javascript:changeImage(-1)&amp;quot;&amp;gt;Prev&amp;lt;/a&amp;gt;
&lt;/pre&gt;

&lt;p&gt;Here i set the parameter as 1, so that the image moves forward on click of next link.&lt;/p&gt;
&lt;pre&gt;
&amp;lt;a href=&amp;quot;javascript:changeImage(1)&amp;quot;&amp;gt;Next&amp;lt;/a&amp;gt;
&lt;/pre&gt;

&lt;p&gt;Now lets see the javascript part.&lt;/p&gt;
&lt;p&gt;The first thing i will do is declare a variable Image which is going to be in an Array.&lt;/p&gt;
&lt;pre&gt;
var Image = new Array(&quot;link to image 1&quot;,&quot;link to image 2&quot;,&quot;link to image 3&quot;);
&lt;/pre&gt;

&lt;p&gt;Lets initialize a variable ImageNumber, so it&#39;s going to start with 0.&lt;/p&gt;
&lt;pre&gt;
var ImageNumber = 0;
&lt;/pre&gt;

&lt;p&gt;Then variable ImageLength which denotes the length of the array. The reason we have -1, say we have 3 array. The array always starts at 0. So we subtract the one.&lt;/p&gt;
&lt;pre&gt;
var ImageLength = Image.length - 1;
&lt;/pre&gt;

&lt;p&gt;Let&#39;s create the function changeImage with parameter as num. We will be sending parameters -1 or 1 to num.&lt;/p&gt;
&lt;pre&gt;
function changeImage(num) {
  ...
}
&lt;/pre&gt;

&lt;p&gt;If you press next first it will take the location of the current image you are at and add 1 to it.&lt;/p&gt;
&lt;pre&gt;
ImageNumber = ImageNumber + num;
&lt;/pre&gt;

&lt;p&gt;Now the problem is if you are at the last image in an array and you click on next link it have to loop to the first image so there will be a connectivity. To do that,&lt;/p&gt;
&lt;pre&gt;
if(ImageNumber &gt; ImageLength) {
   ImageNumber = 0;
}
&lt;/pre&gt;

&lt;p&gt;Same way if you are at the first image and you click on prev link, then there should be a loop connecting to the last image in an array. To obtain that,&lt;/p&gt;
&lt;pre&gt;
if(ImageNumber &lt; 0) {
   ImageNumber = ImageLength;
}
&lt;/pre&gt;

&lt;p&gt;Now what we are going to do is access the image. The slideshow is the name of the image attribute and src is the source  of the image which we are going to access now.&lt;/p&gt;
&lt;pre&gt;
document.slideshow.src = Image[ImageNumber];
&lt;/pre&gt;

&lt;p&gt;Let&#39;s add another link called Auto. On click of this the slideshow works automatically.&lt;/p&gt;
&lt;pre&gt;
&amp;lt;a href=&amp;quot;javascript:auto()&amp;quot;&amp;gt;Auto&amp;lt;/a&amp;gt;
&lt;/pre&gt;
&lt;p&gt;Let&#39;s add a function auto to javascript. Set an interval and add the function changeImage inside the setInterval with positive parameter so that the image moves forward.&lt;/p&gt;
&lt;pre&gt;
function auto() {
  setInterval(&quot;changeImage(1)&quot;, 1000);
}
&lt;/pre&gt;

&lt;p&gt;Now i am going to add caption to each of the image. I am going to add a div tag with id and set that id in javascript. Whenever an image slides the caption is showed for that respective image.&lt;/p&gt;
&lt;pre&gt;
&amp;lt;div id=&amp;quot;caption&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;
&lt;/pre&gt;
&lt;p&gt;Declare another variable Caption and the captions for respective images are going to be in an array&gt; This is the same way we have done to declare the images.&lt;/p&gt;
&lt;pre&gt;
var Caption = new Array(&quot;Caption 1&quot;,&quot;Caption 2&quot;,&quot;Caption 3&quot;);
&lt;/pre&gt;
&lt;p&gt;Write this within the function changeImage.&lt;/p&gt;
&lt;pre&gt;
document.getElementById(&quot;caption&quot;).innerHTML = Caption[ImageNumber];
&lt;/pre&gt;

&lt;p&gt;That&#39;s it your done.&lt;/p&gt;

&lt;p&gt;Let&#39;s combine all the code together now,&lt;/p&gt;
&lt;h4 class=&quot;code-header tltheader&quot;&gt; HTML&lt;/h4&gt;
&lt;pre&gt;
&amp;lt;img src=&amp;quot;image url here&amp;quot; name=&amp;quot;slideshow&amp;quot; /&amp;gt;

&amp;lt;div id=&amp;quot;caption&amp;quot;&amp;gt;Caption 1&amp;lt;/div&amp;gt;

&amp;lt;div&amp;gt;
  &amp;lt;a href=&amp;quot;javascript:changeImage(-1)&amp;quot;&amp;gt;Prev&amp;lt;/a&amp;gt; | &amp;lt;a href=&amp;quot;javascript:changeImage(1)&amp;quot;&amp;gt;Next&amp;lt;/a&amp;gt; | &amp;lt;a href=&amp;quot;javascript:auto()&amp;quot;&amp;gt;Auto&amp;lt;/a&amp;gt;
&amp;lt;/div&amp;gt;
&lt;/pre&gt;

&lt;h4 class=&quot;code-header tltheader&quot;&gt; JavaScript&lt;/h4&gt;
&lt;pre&gt;
var Image = new Array(&quot;link to image 1&quot;,&quot;link to image 2&quot;,&quot;link to image 3&quot;);

var Caption = new Array(&quot;Caption 1&quot;,&quot;Caption 2&quot;,&quot;Caption 3&quot;);

var ImageNumber = 0;

var ImageLength = Image.length - 1;

function changeImage(num) {
  ImageNumber = ImageNumber + num;
  
  if(ImageNumber &gt; ImageLength) {
    ImageNumber = 0;
  }
  
  if(ImageNumber &lt; 0) {
    ImageNumber = ImageLength;
  }
  
  document.slideshow.src = Image[ImageNumber];
  document.getElementById(&quot;caption&quot;).innerHTML = Caption[ImageNumber];
  return false;
}

function auto() {
  setInterval(&quot;changeImage(1)&quot;,1000);
}
&lt;/pre&gt;

&lt;a href=&quot;http://codepen.io/vivinantony/debug/dGPPoq&quot; class=&quot;demo-button&quot;&gt;demo&lt;/a&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://thelittletechie.blogspot.com/feeds/6377656284368864765/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://thelittletechie.blogspot.com/2015/12/simple-slider-without-any-framework.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8625939250791601558/posts/default/6377656284368864765'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8625939250791601558/posts/default/6377656284368864765'/><link rel='alternate' type='text/html' href='http://thelittletechie.blogspot.com/2015/12/simple-slider-without-any-framework.html' title='Simple slider without any framework'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhChN7gOw9Bv9o4QHea5sO2Ufc4kCzywNR5SSVPSzc8n5P5HII7Ro-_dVmxknDk6d9JqIBcUG6PiUhSxUBaTjY8LaOul9AB9Jr1vexiZXTZGDx38f4Iq0nbQN1Af4VvD0TujD-Uu2WC0jQ/s72-c/Simple-slider-without-any-framework.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8625939250791601558.post-1076635433560535619</id><published>2015-12-06T15:32:00.000+05:30</published><updated>2016-02-12T22:32:16.515+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="all"/><category scheme="http://www.blogger.com/atom/ns#" term="css3"/><category scheme="http://www.blogger.com/atom/ns#" term="html5"/><category scheme="http://www.blogger.com/atom/ns#" term="javascript"/><category scheme="http://www.blogger.com/atom/ns#" term="jquery"/><category scheme="http://www.blogger.com/atom/ns#" term="scss"/><title type='text'>Hide div on scroll down, show on scroll up</title><content type='html'>&lt;div class=&quot;tltpost&quot;&gt;
&lt;div class=&quot;tltimg&quot;&gt;
&lt;a href=&quot;/2015/12/hide-div-on-scroll-down-show-on-scroll.html#tlt&quot;&gt;&lt;img src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjpUISqX8vIU1Ycn086c1oPqBoWJo2Eq2tAx_AnGkCf4ALJhLJTNTbxwrmIR8N3fCrygldcCoMNIxmOUI9IzRwpchI2Ycg7tJbjccs6r2KZyqT4g1QxgSuK6JM7sEVHp54j1DUbcTrm8bQ/s1600/Hide-div-on-scroll-down%252C-show-on-scroll-up.jpg&quot; title=&quot;Hide div on scroll down, show on scroll up&quot; alt=&quot;Hide div on scroll down, show on scroll up&quot; /&gt;&lt;/a&gt;
&lt;/div&gt;

&lt;p&gt;Fixed headers are fairly common nowadays with big name brands. More and more people are using mobile phones where screen real estate is a commodity. Even on desktops and tablets applications that get out of the way and let users focus on content feel better. There’s more room to breathe; your eyes don’t feel like squinting.&lt;/p&gt;

&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;

&lt;p&gt;How can we improve on the fixed header pattern? Here’s a proposal: hide the header as the user scrolls down, and show it again when the user scrolls up. This is not revolutionary. Other apps and websites are already doing this, and it’s pretty sweet. Here’s how you do it.&lt;/p&gt;

&lt;p&gt;We’re going to achieve this effect using CSS3 transitions and just a tad of JavaScript. The basic idea is this:&lt;/p&gt;
&lt;ol&gt;
  &lt;li&gt;set the header to position fixed&lt;/li&gt;
  &lt;li&gt;on scroll down, add a class to move the header up&lt;/li&gt;
  &lt;li&gt;on scroll up, remove the class to show the header again&lt;/li&gt;
&lt;/ol&gt;

&lt;h4 class=&quot;code-header tltheader&quot;&gt; HTML&lt;/h4&gt;
&lt;pre&gt;
&amp;lt;header&amp;gt;&amp;lt;/header&amp;gt;
&amp;lt;main&amp;gt;&amp;lt;/main&amp;gt;
&amp;lt;footer&amp;gt;&amp;lt;/footer&amp;gt;
&lt;/pre&gt;

&lt;h4 class=&quot;code-header tltheader&quot;&gt; CSS&lt;/h4&gt;
&lt;pre&gt;
body {
  padding-top: 40px; // same as header height
}
header {
  background: #f5b335;
  height: 40px;
  position: fixed;
  top: 0;
  transition: top 0.2s ease-in-out;
  width: 100%;
}
// we&#39;ll add this class using javascript
.nav-up {
  top: -40px; // same as header height. use variables in LESS/SASS
}
&lt;/pre&gt;

&lt;p&gt;Let’s start off by saying that attaching functions to scroll events can be very expensive to performance. We’ll remedy this by checking if the user has scrolled on an interval instead of executing functions for every pixel scrolled.&lt;/p&gt;

&lt;h4 class=&quot;code-header tltheader&quot;&gt; Javascript&lt;/h4&gt;
&lt;pre&gt;
var didScroll;
// on scroll, let the interval function know the user has scrolled
$(window).scroll(function(event){
  didScroll = true;
});
// run hasScrolled() and reset didScroll status
setInterval(function() {
  if (didScroll) {
    hasScrolled();
    didScroll = false;
  }
}, 250);
function hasScrolled() {
  // do stuff here...
}
&lt;/pre&gt;

&lt;p&gt;On &lt;code&gt;$(window).scroll&lt;/code&gt;, all we do is set the variable &lt;code&gt;didScroll&lt;/code&gt; to true. The interval checks every 250ms if didScroll has changed. If it has, it runs the function and resets didScroll to false. It’s much easier for the browser to set a boolean variable than to run through a whole set of functions for every pixel scrolled.&lt;/p&gt;

&lt;p&gt;To hide the header, we’ll determine the following:&lt;/p&gt;
&lt;ol&gt;
  &lt;li&gt;if they scrolled more than delta&lt;/li&gt;
  &lt;li&gt;if they scrolled past the header height&lt;/li&gt;
  &lt;li&gt;if they scrolled past the header height&lt;/li&gt;
  &lt;li&gt;store the current scroll position in a variable&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Let’s start out by defining all variables at the top.&lt;/p&gt;
&lt;pre&gt;
var lastScrollTop = 0;
var delta = 5;
var navbarHeight = $(‘header’).outerHeight();
&lt;/pre&gt;

&lt;p&gt;Inside &lt;code&gt;hasScrolled()&lt;/code&gt;, store the scroll position in a variable for easy access.&lt;/p&gt;
&lt;pre&gt;
var st = $(this).scrollTop();
&lt;/pre&gt;

&lt;p&gt;Check if they scrolled more than delta.&lt;/p&gt;
&lt;pre&gt;
if (Math.abs(lastScrollTop — st) &lt;= delta)
  return;
&lt;/pre&gt;

&lt;p&gt;Check if they scrolled past the header and if they scrolled up or down.&lt;/p&gt;
&lt;pre&gt;
// If current position &gt; last position AND scrolled past navbar...
if (st &gt; lastScrollTop &amp;&amp; st &gt; navbarHeight){
  // Scroll Down
  $(‘header’).removeClass(‘nav-down’).addClass(‘nav-up’);
} else {
  // Scroll Up
  // If did not scroll past the document (possible on mac)...
  if(st + $(window).height() &lt; $(document).height()) { 
    $(‘header’).removeClass(‘nav-up’).addClass(‘nav-down’);
  }
&lt;/pre&gt;

&lt;p&gt;Set lastScrollTop to the current position.&lt;/p&gt;
&lt;pre&gt;
lastScrollTop = st;
&lt;/pre&gt;

&lt;p&gt;That’s it. It’s as simple as that. Try it and let me know what you think.&lt;/p&gt;

&lt;h4 class=&quot;attachment-header tltheader&quot;&gt; Attachments:&lt;/h4&gt;
&lt;p&gt;Make sure you have jQuery loaded.&lt;/p&gt;
&lt;pre&gt;
//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js
&lt;/pre&gt;

&lt;a href=&quot;http://codepen.io/vivinantony/debug/XXWoQx&quot; class=&quot;demo-button&quot;&gt;demo&lt;/a&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://thelittletechie.blogspot.com/feeds/1076635433560535619/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://thelittletechie.blogspot.com/2015/12/hide-div-on-scroll-down-show-on-scroll.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8625939250791601558/posts/default/1076635433560535619'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8625939250791601558/posts/default/1076635433560535619'/><link rel='alternate' type='text/html' href='http://thelittletechie.blogspot.com/2015/12/hide-div-on-scroll-down-show-on-scroll.html' title='Hide div on scroll down, show on scroll up'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjpUISqX8vIU1Ycn086c1oPqBoWJo2Eq2tAx_AnGkCf4ALJhLJTNTbxwrmIR8N3fCrygldcCoMNIxmOUI9IzRwpchI2Ycg7tJbjccs6r2KZyqT4g1QxgSuK6JM7sEVHp54j1DUbcTrm8bQ/s72-c/Hide-div-on-scroll-down%252C-show-on-scroll-up.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8625939250791601558.post-1346205264005432947</id><published>2015-12-05T19:37:00.000+05:30</published><updated>2017-02-05T16:42:42.941+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="all"/><category scheme="http://www.blogger.com/atom/ns#" term="html"/><category scheme="http://www.blogger.com/atom/ns#" term="scss"/><title type='text'>Minimalist login box</title><content type='html'>&lt;div class=&quot;tltpost&quot;&gt;
&lt;div class=&quot;tltimg&quot;&gt;
&lt;a href=&quot;/2015/12/minimalist-login-box.html#tlt&quot;&gt;&lt;img src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh4h1yffq0CqMy47DSclMdpXUzqglds51KzndVOLwV_bpZsdBZhDqgd-XbME7ZailXSzgx9zfw1p9xURJj2DRYKByuZ23g99R6MWrhxDTw1YQO97x5S5KJdnmM7HVi7QhxIKQdfmuirz1Q/s1600/Minimalist-login-box.jpg&quot; title=&quot;Minimalist login box&quot; alt=&quot;Minimalist login box&quot; /&gt;&lt;/a&gt;
&lt;/div&gt;

&lt;p&gt;A minimalist and a futuristic login box for you. It looks simple and clean without using more spaces. You can reduce the width of the box if required. It is purely responsive.&lt;/p&gt;

&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;

&lt;h4 class=&quot;code-header tltheader&quot;&gt; HTML&lt;/h4&gt;
&lt;pre&gt;
&amp;lt;div class=&amp;quot;body&amp;quot;&amp;gt;
  &amp;lt;form action=&amp;quot;&amp;quot;&amp;gt;
    &amp;lt;input class=&amp;quot;input&amp;quot; type=&amp;quot;text&amp;quot; placeholder=&amp;quot;Username&amp;quot; /&amp;gt;
    &amp;lt;input class=&amp;quot;input&amp;quot; type=&amp;quot;password&amp;quot; placeholder=&amp;quot;Password&amp;quot; /&amp;gt;
    &amp;lt;input type=&amp;quot;button&amp;quot; value=&amp;quot;&amp;#9654;&amp;quot; /&amp;gt;
  &amp;lt;/form&amp;gt;
  &amp;lt;p&amp;gt;Forgot your password? &amp;lt;a href=&amp;quot;#&amp;quot;&amp;gt;click here&amp;lt;/a&amp;gt;&amp;lt;/p&amp;gt;
&amp;lt;/div&amp;gt;
&lt;/pre&gt;

&lt;h4 class=&quot;code-header tltheader&quot;&gt; SCSS&lt;/h4&gt;
&lt;pre&gt;
* {
  box-sizing: border-box;  
  position: relative;
}

$prim-col: #111;
$sec-col: #333;
$prim-font-col: #eee;
$sec-font-col: #ddd;
$btn-border-col: #588c73;

body {
  background: #588c73
}

.body {
  font-family: &quot;Open Sans&quot;;
  font-size: 10px;

 .input {
    background: transparent;
    border: 0;
    color: #eee;
    font-family: &quot;Open Sans&quot;;
    font-size: 1.5em;
    height: 5em;
    width: 100%;
  }
  
  input[type=&quot;text&quot;] {
    border-bottom: .1em solid $sec-col;
  }

  input[type=&quot;password&quot;] {
    border-top: .1em solid $sec-col;
  }

  input[type=&quot;button&quot;] {
    background: $prim-col;
    border: .4rem solid $btn-border-col;
    border-radius: 100%;
    color: $prim-font-col;
    font-size: 2vmax;
    font-size: 1.2rem;
    height: 3em;
    position: absolute;
    right: -1.5em;
    top: 2.8rem;
    width: 3em;
    cursor: pointer;
  }

  input:focus {
    outline: 0;
  }

  form {
    background: $prim-col;
    border-radius: 1em;
    margin: 5vmax auto 0;
    padding: 0 2em;
    width: 50vmax;
  }

  p {
    color: $sec-font-col;
    font-size: 1.5em;
    font-weight: bold;
    margin: 1em auto;
    padding-left: 1.3em;
    width: 50%;
  }

  a {
    color: $sec-font-col;
    text-decoration: none;
  }
}
&lt;/pre&gt;

&lt;h4 class=&quot;attachment-header tltheader&quot;&gt; Attachments:&lt;/h4&gt;
&lt;p&gt;I have used Open Sans from google font.&lt;/p&gt;
&lt;pre&gt;
https://fonts.googleapis.com/css?family=Open+Sans
&lt;/pre&gt;

&lt;a href=&quot;http://codepen.io/vivinantony/debug/gPOKpg&quot; class=&quot;demo-button&quot;&gt;demo&lt;/a&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://thelittletechie.blogspot.com/feeds/1346205264005432947/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://thelittletechie.blogspot.com/2015/12/minimalist-login-box.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8625939250791601558/posts/default/1346205264005432947'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8625939250791601558/posts/default/1346205264005432947'/><link rel='alternate' type='text/html' href='http://thelittletechie.blogspot.com/2015/12/minimalist-login-box.html' title='Minimalist login box'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh4h1yffq0CqMy47DSclMdpXUzqglds51KzndVOLwV_bpZsdBZhDqgd-XbME7ZailXSzgx9zfw1p9xURJj2DRYKByuZ23g99R6MWrhxDTw1YQO97x5S5KJdnmM7HVi7QhxIKQdfmuirz1Q/s72-c/Minimalist-login-box.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8625939250791601558.post-6535136216295397692</id><published>2015-11-25T20:33:00.000+05:30</published><updated>2017-02-05T16:42:53.292+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="all"/><category scheme="http://www.blogger.com/atom/ns#" term="html"/><category scheme="http://www.blogger.com/atom/ns#" term="jquery"/><category scheme="http://www.blogger.com/atom/ns#" term="sass"/><title type='text'>Fancy navigation</title><content type='html'>&lt;div class=&quot;tltpost&quot;&gt;
&lt;div class=&quot;tltimg&quot;&gt;
&lt;a href=&quot;/2015/11/fancy-navigation.html#tlt&quot;&gt;&lt;img src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgDKcSdIz2K9eyuQpxuWvJQRDGFvYDaAS05RjaO57gZ0pHEW2miAorIz9cXE0Aoqq0cC76PgDvNw-Um9iMNHqDI_Lz1pnfeMV8HvUmpmOGe8XZ04UChvN0Rf0GsJ2QTg3lxFCKU9EIUXos/s1600/fancy-navigation.jpg&quot; title=&quot;Fancy navigation&quot; alt=&quot;Fancy navigation&quot; /&gt;&lt;/a&gt;
&lt;/div&gt;

&lt;p&gt;A fancy navigation style based on the material design and animations.&lt;/p&gt;

&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;

&lt;h4 class=&quot;code-header tltheader&quot;&gt; HTML&lt;/h4&gt;
&lt;pre&gt;
&amp;lt;div class=&#39;contain&#39;&amp;gt;
  &amp;lt;section class=&#39;home active&#39;&amp;gt;
    &amp;lt;h1 class=&#39;title&#39;&amp;gt;Home&amp;lt;/h1&amp;gt;
  &amp;lt;/section&amp;gt;
  &amp;lt;section class=&#39;about&#39;&amp;gt;
    &amp;lt;h1 class=&#39;title&#39;&amp;gt;About&amp;lt;/h1&amp;gt;
  &amp;lt;/section&amp;gt;
  &amp;lt;section class=&#39;work&#39;&amp;gt;
    &amp;lt;h1 class=&#39;title&#39;&amp;gt;Work&amp;lt;/h1&amp;gt;
  &amp;lt;/section&amp;gt;
  &amp;lt;section class=&#39;contact&#39;&amp;gt;
    &amp;lt;h1 class=&#39;title&#39;&amp;gt;Contact&amp;lt;/h1&amp;gt;
  &amp;lt;/section&amp;gt;
&amp;lt;/div&amp;gt;
&amp;lt;a class=&#39;toggle&#39; href=&#39;#&#39;&amp;gt;
  &amp;lt;span class=&#39;bar&#39;&amp;gt;&amp;lt;/span&amp;gt;
  &amp;lt;span class=&#39;bar&#39;&amp;gt;&amp;lt;/span&amp;gt;
  &amp;lt;span class=&#39;bar&#39;&amp;gt;&amp;lt;/span&amp;gt;
&amp;lt;/a&amp;gt;
&lt;/pre&gt;

&lt;h4 class=&quot;code-header tltheader&quot;&gt; SASS&lt;/h4&gt;
&lt;pre&gt;
$body:    #f9f9f9
$home:    #2196F3
$about:   #FFC107
$work:    #4CAF50
$contact: #F44336

body
  font-weight: 300
  font-family: &#39;Raleway&#39;, sans-serif
  background: #fff
  background: radial-gradient(ellipse at center, rgba(0,0,0,0) 0%,rgba(0,0,0,0.05) 80%, rgba(0,0,0,0.15) 100%)
  overflow: hidden
  transform-style: preserve-3d
p
  color: #fff
  font-size: 22px
  font-family: &#39;Merriweather&#39;, serif
  text-align: center
  a
    color: #fff
    text-decoration: none
a.toggle
  display: block
  position: fixed
  top: 20px
  left: 25px
  z-index: 1000
  transform: rotate(0deg)
  transition: all 500ms
  .bar
    display: block
    width: 35px
    height: 4px
    margin: 6px auto
    background: rgba(0,0,0,0.25)
    transition: all 500ms
  &amp;:hover
    .bar
      background: white
.contain
  width: 100%
  height: 100vh
  transition: all 500ms
  transform-style: preserve-3d
  section
    position: absolute
    top: 100vh
    width: 100%
    height: 100vh
    overflow: hidden
    transition: top 500ms
    transform-style: preserve-3d
    &amp;.active
      top: 0
    &amp;.home
      background: $home
    &amp;.about
      background: $about
    &amp;.work
      background: $work
    &amp;.contact
      background: $contact
  h1
    margin: 0
    font-size: 64px
    
    text-align: center
    color: rgba(255,255,255,0.85)
    transition: transform 500ms
    transform-style: preserve-3d   

.contain.active
  transform: scale(0.65) translateY(-18%)
  transition: all 500ms
  transform-style: preserve-3d
  + a.toggle
    top: 30px
    left: 20px
    transform: rotate(225deg)
    transition: all 500ms
    transform-origin: center center
    .bar
      background: #646464
      transition: all 500ms
      &amp;:nth-child(2)
        opacity: 0
        transition: opacity 0s
      &amp;:nth-child(3)
        margin-top: -20px
        transform: rotate(90deg)
  section
    cursor: pointer
    overflow: hidden
    opacity: 1
    box-shadow: 0 0 40px rgba(0,0,0,0.25)
    transform-style: preserve-3d 
  h1
    transform: scale(0.5)
    transform-style: preserve-3d
    //&amp;:hover
      //background: rgab(0,0,0,0.25)


@for $i from 1 through 4
  .contain section:nth-child(#{$i})
    z-index: 100 - $i
  .contain.active section:nth-child(#{$i})
    top: 48vh + (-12vh * $i)
    &amp;:hover
      top: 47vh + (-12vh * $i)
&lt;/pre&gt;

&lt;h4 class=&quot;code-header tltheader&quot;&gt; jQuery&lt;/h4&gt;
&lt;pre&gt;
$(&#39;a.toggle&#39;).on(&#39;click&#39;, function(){
  $(&#39;section&#39;).scrollTop(0);
  $(&#39;.contain&#39;).toggleClass(&#39;active&#39;);
  return false;
})

$(&#39;section&#39;).on(&#39;click&#39;, function(){
  $(&#39;section&#39;).removeClass(&#39;active&#39;);
  $(this).addClass(&#39;active&#39;);
  $(&#39;.contain&#39;).removeClass(&#39;active&#39;);
})
&lt;/pre&gt;

&lt;h4 class=&quot;attachment-header tltheader&quot;&gt; Attachments:&lt;/h4&gt;
&lt;p&gt;I have used external attachments.&lt;/p&gt;
&lt;pre&gt;
http://fonts.googleapis.com/css?family=Raleway:600,400,200,300
//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js
&lt;/pre&gt;

&lt;h4 class=&quot;note-header tltheader&quot;&gt; Note:&lt;/h4&gt;
&lt;p&gt;Add this to the header section,&lt;/p&gt;
&lt;pre&gt;
&amp;lt;meta name=&amp;quot;viewport&amp;quot; content=&amp;quot;width=device-width&amp;quot;&amp;gt;
&lt;/pre&gt;

&lt;a href=&quot;http://s.codepen.io/vivinantony/debug/RWzbmO&quot; class=&quot;demo-button&quot;&gt;demo&lt;/a&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://thelittletechie.blogspot.com/feeds/6535136216295397692/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://thelittletechie.blogspot.com/2015/11/fancy-navigation.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8625939250791601558/posts/default/6535136216295397692'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8625939250791601558/posts/default/6535136216295397692'/><link rel='alternate' type='text/html' href='http://thelittletechie.blogspot.com/2015/11/fancy-navigation.html' title='Fancy navigation'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgDKcSdIz2K9eyuQpxuWvJQRDGFvYDaAS05RjaO57gZ0pHEW2miAorIz9cXE0Aoqq0cC76PgDvNw-Um9iMNHqDI_Lz1pnfeMV8HvUmpmOGe8XZ04UChvN0Rf0GsJ2QTg3lxFCKU9EIUXos/s72-c/fancy-navigation.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8625939250791601558.post-4421009081369135424</id><published>2015-11-17T00:31:00.000+05:30</published><updated>2017-02-05T16:43:03.162+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="all"/><category scheme="http://www.blogger.com/atom/ns#" term="css"/><category scheme="http://www.blogger.com/atom/ns#" term="html"/><category scheme="http://www.blogger.com/atom/ns#" term="jquery"/><title type='text'>Smooth scrolling full width page</title><content type='html'>&lt;div class=&quot;tltpost&quot;&gt;
&lt;div class=&quot;tltimg&quot;&gt;
&lt;a href=&quot;/2015/11/smooth-scrolling-full-width-page.html#tlt&quot;&gt;&lt;img src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgiCYLKsrQqTipxqyxCKak1cu5cfCk4o_J_79qVHpb086a9f7SMjR4pNP6Yoq9iz5MnsnuWozJjg8tEj6r8wITZPpWy69CS2Acjm7PQhZoCHYH-cgwUTeQngoSo9aDcyXOC5_GYaNbGCxo/s1600/Smooth-scrolling-full-width-page.jpg&quot; title=&quot;Smooth scrolling full width page&quot; alt=&quot;Smooth scrolling full width page&quot; /&gt;&lt;/a&gt;
&lt;/div&gt;

&lt;p&gt;Responsive smooth scrolling full width page. It is done with the help of fullpage jquery.&lt;/p&gt;

&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;

&lt;h4 class=&quot;code-header tltheader&quot;&gt; HTML&lt;/h4&gt;
&lt;pre&gt;
&amp;lt;div class=&amp;quot;page-container body&amp;quot;&amp;gt;
  &amp;lt;div class=&amp;quot;section&amp;quot; id=&amp;quot;section1&amp;quot;&amp;gt;
    &amp;lt;div class=&amp;quot;section-content&amp;quot;&amp;gt;
      &amp;lt;p&amp;gt;&amp;lt;i class=&amp;quot;fa fa-home&amp;quot;&amp;gt;&amp;lt;/i&amp;gt;&amp;lt;/p&amp;gt;
      &amp;lt;p&amp;gt;Home&amp;lt;/p&amp;gt;
    &amp;lt;/div&amp;gt;
  &amp;lt;/div&amp;gt;
  &amp;lt;div class=&amp;quot;section&amp;quot; id=&amp;quot;section2&amp;quot;&amp;gt;
    &amp;lt;div class=&amp;quot;section-content&amp;quot;&amp;gt;
      &amp;lt;p&amp;gt;&amp;lt;i class=&amp;quot;fa fa-user&amp;quot;&amp;gt;&amp;lt;/i&amp;gt;&amp;lt;/p&amp;gt;
      &amp;lt;p&amp;gt;About&amp;lt;/p&amp;gt;
    &amp;lt;/div&amp;gt;
  &amp;lt;/div&amp;gt;
  &amp;lt;div class=&amp;quot;section&amp;quot; id=&amp;quot;section3&amp;quot;&amp;gt;
    &amp;lt;div class=&amp;quot;section-content&amp;quot;&amp;gt;
      &amp;lt;p&amp;gt;&amp;lt;i class=&amp;quot;fa fa-image&amp;quot;&amp;gt;&amp;lt;/i&amp;gt;&amp;lt;/p&amp;gt;
      &amp;lt;p&amp;gt;Portfolio&amp;lt;/p&amp;gt;
    &amp;lt;/div&amp;gt;
  &amp;lt;/div&amp;gt;
  &amp;lt;div class=&amp;quot;section&amp;quot; id=&amp;quot;section4&amp;quot;&amp;gt;
    &amp;lt;div class=&amp;quot;section-content&amp;quot;&amp;gt;
      &amp;lt;p&amp;gt;&amp;lt;i class=&amp;quot;fa fa-pencil&amp;quot;&amp;gt;&amp;lt;/i&amp;gt;&amp;lt;/p&amp;gt;
      &amp;lt;p&amp;gt;Tutorial&amp;lt;/p&amp;gt;
    &amp;lt;/div&amp;gt;
  &amp;lt;/div&amp;gt;
  &amp;lt;div class=&amp;quot;section&amp;quot; id=&amp;quot;section5&amp;quot;&amp;gt;
    &amp;lt;div class=&amp;quot;section-content&amp;quot;&amp;gt;
      &amp;lt;p&amp;gt;&amp;lt;i class=&amp;quot;fa fa-phone&amp;quot;&amp;gt;&amp;lt;/i&amp;gt;&amp;lt;/p&amp;gt;
      &amp;lt;p&amp;gt;Contact&amp;lt;/p&amp;gt;
    &amp;lt;/div&amp;gt;
  &amp;lt;/div&amp;gt;
&amp;lt;/div&amp;gt;
&lt;/pre&gt;

&lt;h4 class=&quot;code-header tltheader&quot;&gt; CSS&lt;/h4&gt;
&lt;pre&gt;
@import url(https://fonts.googleapis.com/css?family=Lobster);

.body {
  font-family: &#39;Lobster&#39;, cursive;
}

p {
  margin: 0;
}

.section {
  background-size: cover;
  background-position: center;
}

.section-content {
  text-align: center;
  font-size: 3em;
  color: #fff;
}

#section1 {
  background-color: #FF82A9;
}

#section2 {
  background-color: #7F95D1;
}

#section3 {
  background-color: #F2BB05;
}

#section4 {
  background-color: #26A65B;
}

#section5 {
  background-color: #E35101;
}
&lt;/pre&gt;

&lt;h4 class=&quot;code-header tltheader&quot;&gt; jQuery&lt;/h4&gt;
&lt;pre&gt;
$(function(){
  $(&#39;.page-container&#39;).fullpage({
    navigation: true,
    navigationPosition: &#39;right&#39;
  });
});
&lt;/pre&gt;

&lt;h4 class=&quot;attachment-header tltheader&quot;&gt; Attachments:&lt;/h4&gt;
&lt;p&gt;I have used external attachments.&lt;/p&gt;
&lt;pre&gt;
https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.4.0/css/font-awesome.min.css
https://cdnjs.cloudflare.com/ajax/libs/fullPage.js/2.7.4/jquery.fullPage.min.css

https//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js
https//cdnjs.cloudflare.com/ajax/libs/fullPage.js/2.7.4/jquery.fullPage.min.js
&lt;/pre&gt;

&lt;a href=&quot;http://codepen.io/vivinantony/debug/YyBYWv&quot; class=&quot;demo-button&quot;&gt;demo&lt;/a&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://thelittletechie.blogspot.com/feeds/4421009081369135424/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://thelittletechie.blogspot.com/2015/11/smooth-scrolling-full-width-page.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8625939250791601558/posts/default/4421009081369135424'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8625939250791601558/posts/default/4421009081369135424'/><link rel='alternate' type='text/html' href='http://thelittletechie.blogspot.com/2015/11/smooth-scrolling-full-width-page.html' title='Smooth scrolling full width page'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgiCYLKsrQqTipxqyxCKak1cu5cfCk4o_J_79qVHpb086a9f7SMjR4pNP6Yoq9iz5MnsnuWozJjg8tEj6r8wITZPpWy69CS2Acjm7PQhZoCHYH-cgwUTeQngoSo9aDcyXOC5_GYaNbGCxo/s72-c/Smooth-scrolling-full-width-page.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8625939250791601558.post-7111621879965225702</id><published>2015-11-10T20:33:00.000+05:30</published><updated>2017-02-05T16:43:10.638+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="all"/><category scheme="http://www.blogger.com/atom/ns#" term="html"/><category scheme="http://www.blogger.com/atom/ns#" term="scss"/><title type='text'>Happy Halloween</title><content type='html'>&lt;div class=&quot;tltpost&quot;&gt;
&lt;div class=&quot;tltimg&quot;&gt;
&lt;a href=&quot;/2015/11/happy-halloween.html#tlt&quot;&gt;&lt;img src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgnlGDsCFw_J2HlRM2x_64d-69VoSlWs0eihyphenhyphen7XOxjIvlsL2CqJwlBvnvma4yXT1rCP3PmkndsWDJDp1cpYE2ENDnjk3IbQSjZJFuX9ddHBmEvpZcJZAi_COiruNYawrqaWIditZe-C1gE/s1600/happy-halloween.jpg&quot; title=&quot;Happy Halloween&quot; alt=&quot;Happy Halloween&quot; /&gt;&lt;/a&gt;
&lt;/div&gt;

&lt;p&gt;Halloween pumpkin made using box-shadows, clip paths and html shapes. The highlight thing is the candle effect which is done using CSS animations.&lt;/p&gt;

&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;

&lt;h4 class=&quot;code-header tltheader&quot;&gt; HTML&lt;/h4&gt;
&lt;pre&gt;
&amp;lt;div class=&amp;quot;body&amp;quot;&amp;gt;
  &amp;lt;div class=&amp;quot;pumpkin&amp;quot;&amp;gt;
    &amp;lt;div class=&amp;quot;front left&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;
    &amp;lt;div class=&amp;quot;front right&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;
    &amp;lt;div class=&amp;quot;top-dent-back left&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;
    &amp;lt;div class=&amp;quot;top-dent-back right&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;
    &amp;lt;div class=&amp;quot;top-dent-front left&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;
    &amp;lt;div class=&amp;quot;top-dent-front right&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;
    &amp;lt;div class=&amp;quot;stalk&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;
    &amp;lt;div class=&amp;quot;stalk-shadow&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;
    &amp;lt;div class=&amp;quot;eye left&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;
    &amp;lt;div class=&amp;quot;eye right&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;
    &amp;lt;div class=&amp;quot;nose&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;
    &amp;lt;div class=&amp;quot;mouth&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;
    &amp;lt;div class=&amp;quot;bottom-shadow&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;
    &amp;lt;div class=&amp;quot;candle eye left&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;
    &amp;lt;div class=&amp;quot;candle eye right&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;
    &amp;lt;div class=&amp;quot;candle nose&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;
    &amp;lt;div class=&amp;quot;candle mouth&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;
  &amp;lt;/div&amp;gt;
&amp;lt;/div&amp;gt;
&lt;/pre&gt;

&lt;h4 class=&quot;code-header tltheader&quot;&gt; SCSS&lt;/h4&gt;
&lt;pre&gt;
@import &#39;compass&#39;;$p-height: 200px;$p-width: 240px;.body {
  height: $p-height * 1.2;
  width: 100%;
  margin: 10% auto;
}$pumpkin-thickness: 8px;.pumpkin {
  position: relative;
  left: calc(50% - (#{$p-width;
}/2));height: $p-height;width: $p-width;background: #E37100;@include border-radius(45% 45% 40% 40% / 43% 43% 50% 50%);@include box-shadow(inset 0 -20px 20px 0px rgba(0,0,0,0.4));:before, :after {
  content: &quot;&quot;;
  position: absolute;
  height: 0;
  width: 0;
}

* {
  position: absolute;
}

.front {
  height: 94%;
  width: 50%;
  bottom: 0;
  z-index: 2;
  &amp;: before{top: 5%;
  height: 94%;
  width: 85%;
  @include border-radius(inherit);
}&amp;:after {
  top: 12%;
  height: 85%;
  width: 40%;
  @include border-radius(inherit);
}&amp;.left {
  @include box-shadow(inset 5px 5px 10px -5px rgba(0,0,0,0.3));@include border-radius(65% 35% 10% 85% / 45% 20% 10% 60%);left: 0;
  &amp;: before{left: 20%;
  @include box-shadow( -7px 0 5px -5px rgba(0,0,0,0.3));
}&amp;:after {
  left: 60%;
  @include box-shadow( -7px 0 5px -5px rgba(0,0,0,0.3));
}}&amp;.right {
  @include box-shadow(inset -5px 5px 10px -5px rgba(0,0,0,0.3));@include border-radius(35% 65% 85% 10% / 20% 45% 60% 10%);right: 0;
  &amp;: before{right: 20%;
  @include box-shadow( 7px 0 5px -5px rgba(0,0,0,0.3));
}&amp;:after {
  right: 60%;
  @include box-shadow( 7px 0 5px -5px rgba(0,0,0,0.3));
}}}

.top-dent-back,.top-dent-front {
  height: 30px;
  width: 20px;
  @include border-radius(50%);
}$dent-rotate-back: 110deg;$dent-rotate-front: 90deg;.top-dent-back {
  top: 3px;
  &amp;.left{left: 80px;
  @include transform(rotate($dent-rotate-back));@include box-shadow( -7px 0 5px -5px rgba(0,0,0,0.3));
}&amp;.right {
  right: 80px;
  @include transform(rotate(-$dent-rotate-back));@include box-shadow( 7px 0 5px -5px rgba(0,0,0,0.3));
}}

.top-dent-front {
  top: 18px;
  &amp;.left{left: 90px;
  @include transform(rotate($dent-rotate-front));@include box-shadow( -7px 0 5px -5px rgba(0,0,0,0.2));
}&amp;.right {
  right: 90px;
  @include transform(rotate(-$dent-rotate-front));@include box-shadow( 7px 0 5px -5px rgba(0,0,0,0.2));
}}

.stalk {
  top: -5px;
  left: calc(50% - 15px);
  height: 30px;
  width: 30px;
  z-index: 1;
  background: #35260F;
  @include border-radius(10% 10% 50% 50% / 90% 90% 20% 20%);@include transform(rotate(5deg));
}

.stalk-shadow {
  top: -10px;
  left: calc(50% - 60px);
  height: 50px;
  width: 120px;
  @include filter-gradient(#000000, #000000, horizontal);@include background-image(radial-gradient(center, ellipse cover,rgba(0,0,0,1) 0%,rgba(0,0,0,0) 50%));opacity: 0.4;
}

.eye {
  top: 65px;
  height: 35px;
  width: 70px;
  background: #5A2504;
  z-index: 4;
  $eye-position: 38px;
  $eye-rotate: 25deg;
  &amp;: before{height: 100%;
  width: 87%;
  @include border-radius(inherit);z-index: 3;
}&amp;.left {
  left: $eye-position;
  @include transform(rotate($eye-rotate));@include border-radius(10% 10% 40% 60% / 0% 30% 50% 95%);&amp;: before{left: $pumpkin-thickness;
  @include box-shadow(-$pumpkin-thickness 0 0 0 #AD4B07);border-right: 1px solid darken(#AD4B07, 10%);
}}&amp;.right {
  right: $eye-position;
  @include transform(rotate(-$eye-rotate));@include border-radius(10% 10% 60% 40% / 30% 0% 95% 50%);&amp;: before{right: $pumpkin-thickness;
  @include box-shadow($pumpkin-thickness 0 0 0 #AD4B07);border-right: 1px solid darken(#AD4B07, 10%);
}}}

.nose {
  top: 105px;
  left: calc(50% - 13px);
  height: 26px;
  width: 26px;
  background: #AD4B07;
  z-index: 4;
  -webkit-clip-path: polygon(0% 100%, 50% 0%, 100% 100%);
  clip-path: polygon(0% 100%, 50% 0%, 100% 100%);
  overflow: hidden;
  &amp;: before{left: 15%;
  top: 15%;
  height: 70%;
  width: 70%;
  background: #5A2504;
  -webkit-clip-path: polygon(0% 100%, 50% 0%, 100% 100%);
  clip-path: polygon(0% 100%, 50% 0%, 100% 100%);
}}

.mouth {
  top: 65px;
  left: calc(50% - 80px);
  height: 110px;
  width: 160px;
  z-index: 3;
  background: #5A2504;
  -webkit-clip-path: polygon(0% 58%, 7% 65%, 19% 70%, 22% 71%, 28% 82%, 33% 74%, 38% 74%, 50% 75%, 62% 74%, 67% 74%, 72% 82%, 78% 71%, 81% 70%, 93% 65%,100% 58%, 94% 75%, 86% 89%, 79% 94%, 70% 98%, 60% 100%, 56% 100%, 50% 88%, 44% 100%, 40% 100%, 30% 98%, 21% 95%, 14% 89%, 6% 75%);
  clip-path: polygon(0% 58%, 7% 65%, 19% 70%, 22% 71%, 28% 82%, 33% 74%, 38% 74%, 50% 75%, 62% 74%, 67% 74%, 72% 82%, 78% 71%, 81% 70%, 93% 65%,100% 58%, 94% 75%, 86% 89%, 79% 94%, 70% 98%, 60% 100%, 56% 100%, 50% 88%, 44% 100%, 40% 100%, 30% 98%, 21% 95%, 14% 89%, 6% 75%);
  overflow: hidden;
  &amp;: before{left: $pumpkin-thickness;
  height: 100%;
  width: calc(100% - (#{$pumpkin-thickness;
}

* 2));background: #5A2504;top: -$pumpkin-thickness;-webkit-clip-path: polygon(0% 58%, 7% 65%, 19% 70%, 22% 71%, 26% 89%, 30% 87%, 38% 74%, 50% 75%, 62% 74%, 70% 87%, 74% 89%, 78% 71%, 81% 70%, 93% 65%,100% 58%, 94% 75%, 86% 89%, 79% 94%, 70% 98%, 60% 100%, 56% 100%, 50% 90%, 44% 100%, 40% 100%, 30% 98%, 21% 95%, 14% 89%, 6% 75%);clip-path: polygon(0% 58%, 7% 65%, 19% 70%, 22% 71%, 28% 82%, 33% 74%, 38% 74%, 50% 75%, 62% 74%, 65% 82%, 74% 90%, 78% 71%, 81% 70%, 93% 65%,100% 58%, 94% 75%, 86% 89%, 79% 94%, 70% 98%, 60% 100%, 56% 100%, 50% 90%, 44% 100%, 40% 100%, 30% 98%, 21% 95%, 14% 89%, 6% 75%);z-index: 2;
}&amp;:after {
left: 0;
height: 100%;
width: 100%;
background: #AD4B07;
z-index: 1;
}}

.bottom-shadow {
bottom: -195px;
left: calc(50% - 250px);
width: 500px;
height: 400px;
background: radial-gradient(circle at 50% 50%, rgba(0,0,0, 0.8), rgba(0,0,0, 0.2) 25%, rgba(0,0,0, 0) 35%);
z-index: -1;
@include transform(scaleY(0.2));
}

.candle {
background: rgba(yellow, 0.5);
z-index: 15;
@include box-shadow( 0 0 50px 2px rgba(yellow, 0.8));&amp;: before, &amp;:after{display: none;
}&amp;.nose, &amp;.mouth {
@include box-shadow(none);
}}}

@keyframes candle {
0%, 100% {
  opacity: 0;
}

50% {
  opacity: 1;
}}

.candle {
  @include animation(candle linear 3s infinite);
}   
&lt;/pre&gt;


&lt;a href=&quot;http://s.codepen.io/vivinantony/debug/RWqoyg&quot; class=&quot;demo-button&quot;&gt;demo&lt;/a&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://thelittletechie.blogspot.com/feeds/7111621879965225702/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://thelittletechie.blogspot.com/2015/11/happy-halloween.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8625939250791601558/posts/default/7111621879965225702'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8625939250791601558/posts/default/7111621879965225702'/><link rel='alternate' type='text/html' href='http://thelittletechie.blogspot.com/2015/11/happy-halloween.html' title='Happy Halloween'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgnlGDsCFw_J2HlRM2x_64d-69VoSlWs0eihyphenhyphen7XOxjIvlsL2CqJwlBvnvma4yXT1rCP3PmkndsWDJDp1cpYE2ENDnjk3IbQSjZJFuX9ddHBmEvpZcJZAi_COiruNYawrqaWIditZe-C1gE/s72-c/happy-halloween.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8625939250791601558.post-4361818529935322259</id><published>2015-08-25T10:38:00.000+05:30</published><updated>2017-02-05T16:43:17.686+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="all"/><category scheme="http://www.blogger.com/atom/ns#" term="Ember.js"/><category scheme="http://www.blogger.com/atom/ns#" term="tricks"/><title type='text'>Install Ember</title><content type='html'>&lt;div class=&quot;tltpost&quot;&gt;
&lt;div class=&quot;tltimg&quot;&gt;
&lt;a href=&quot;/2015/08/install-ember.html#tlt&quot;&gt;&lt;img src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjysjO8YsQHvnZTRf3l-_DVkBOpmnlMz5TCreh3GKWJUgA3KpOy1iql5esEpkJUgOSUKBsdlAWAX7oVVdiz1zxd1l4Mnnu17nHAF4o69g11LW9Z-YiqjDE6YSeebCWEHa8PVq_mrj0dvnI/s1600/how-to-install-ember.jpg&quot; title=&quot;The Little Techie&quot; alt=&quot;The Little Techie&quot; /&gt;&lt;/a&gt;
&lt;/div&gt;

&lt;p&gt;Ember.js is a framework for creating ambitious web applications. Ember.js is an open-source JavaScript application framework, based on the model-view-controller (MVC) pattern. It allows developers to create scalable single-page web applications.&lt;/p&gt;

&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;

&lt;p&gt;Installing ember.js into your work environment is easy and straight forward. All you need is good internet connection and some basic computer knowledge.&lt;/p&gt;

&lt;p&gt;I will show you how to install ember.js step by step.&lt;/p&gt;

&lt;h4 class=&quot;default-header tltheader&quot;&gt; Step 1:&lt;/h4&gt;
&lt;p&gt;Download and install &lt;a href=&quot;https://nodejs.org/download/&quot; target=&quot;_blank&quot;&gt;NodeJS&lt;/a&gt;.&lt;/p&gt;

&lt;h4 class=&quot;default-header tltheader&quot;&gt; Step 2:&lt;/h4&gt;
&lt;p&gt;Download and install &lt;a href=&quot;https://git-scm.com/&quot; target=&quot;_blank&quot;&gt;Git&lt;/a&gt;.&lt;/p&gt;

&lt;h4 class=&quot;default-header tltheader&quot;&gt; Step 3:&lt;/h4&gt;
&lt;p&gt;Reference NodeJS and Git in the systems PATH. Append to the existing path, as below. (Note: If you are not sure where to do this: In case of windows users - Right click on your computer and click on properties &amp;gt; advanced system settings &amp;gt; enviroment variables.)&lt;/p&gt;
&lt;pre&gt;
%Git installation folder%\cmd; %Git installation folder%\bin; %Node installation folder%\;
&lt;/pre&gt;
&lt;pre&gt;
Example:
C:\Program Files (x86)\Git\cmd; C:\Program Files (x86)\Git\bin; C:\NodeJs\;
&lt;/pre&gt;
&lt;p&gt;In most cases the path to node installation folder will be added to the system path when you install NodeJS. If not add it.&lt;/p&gt;
&lt;p&gt;To check whether NodeJS and Git is installed and the path is set properly, open command prompt. Type &lt;code&gt;node -v&lt;/code&gt; or &lt;code&gt;node --version&lt;/code&gt; which should show the version of it, if it is properly installed, else it says unknown command. Same way check for git by typing &lt;code&gt;git --version&lt;/code&gt;.&lt;/p&gt;

&lt;h4 class=&quot;default-header tltheader&quot;&gt; Step 4:&lt;/h4&gt;
&lt;p&gt;Open Node.js command prompt and type the following command,&lt;/p&gt;
&lt;pre&gt;
npm install -g ember-cli
&lt;/pre&gt;
&lt;p&gt;This installs ember-cli. You can even use command prompt instead of Node.js command prompt.&lt;/p&gt;

&lt;h4 class=&quot;default-header tltheader&quot;&gt; Step 5:&lt;/h4&gt;
&lt;p&gt;Open Node.js command prompt and type the following command,&lt;/p&gt;
&lt;pre&gt;
npm install -g bower
&lt;/pre&gt;
&lt;p&gt;This installs bower components to your system.&lt;/p&gt;

&lt;h4 class=&quot;default-header tltheader&quot;&gt; Step 6:&lt;/h4&gt;
&lt;p&gt;Create your project directory. To do this run the command,&lt;/p&gt;
&lt;pre&gt;
ember new my-app
&lt;/pre&gt;
&lt;p&gt;This will create a new &lt;code&gt;my-app&lt;/code&gt; folder and generate an application structure for you.&lt;/p&gt;
&lt;p&gt;You can either do the above or if your project is checked into SVN or GIT you can use that. This can either be done by installing tortoiseSVN in case of SVN or tortoiseGIT in case of  GIT.&lt;/p&gt;

&lt;h4 class=&quot;default-header tltheader&quot;&gt; Step 7:&lt;/h4&gt;
&lt;p&gt;Open the project directory (Example: D:/my-app) and give the command,&lt;/p&gt;
&lt;pre&gt;
npm install
&lt;/pre&gt;

&lt;h4 class=&quot;default-header tltheader&quot;&gt; Step 9:&lt;/h4&gt;
&lt;p&gt;Open the project directory and give the command,&lt;/p&gt;
&lt;pre&gt;
bower install
&lt;/pre&gt;

&lt;h4 class=&quot;default-header tltheader&quot;&gt; Step 10:&lt;/h4&gt;
&lt;p&gt;Open the project directory and give the command,&lt;/p&gt;
&lt;pre&gt;
ember build
&lt;/pre&gt;

&lt;h4 class=&quot;default-header tltheader&quot;&gt; Step 11:&lt;/h4&gt;
&lt;p&gt;Open the project directory and give the command,&lt;/p&gt;
&lt;pre&gt;
ember server
&lt;/pre&gt;
&lt;p&gt;This starts the ember server. Your webpage will be loaded in your favorite browser. (Say: http://localhost:4200)&lt;/p&gt;

&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://thelittletechie.blogspot.com/feeds/4361818529935322259/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://thelittletechie.blogspot.com/2015/08/install-ember.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8625939250791601558/posts/default/4361818529935322259'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8625939250791601558/posts/default/4361818529935322259'/><link rel='alternate' type='text/html' href='http://thelittletechie.blogspot.com/2015/08/install-ember.html' title='Install Ember'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjysjO8YsQHvnZTRf3l-_DVkBOpmnlMz5TCreh3GKWJUgA3KpOy1iql5esEpkJUgOSUKBsdlAWAX7oVVdiz1zxd1l4Mnnu17nHAF4o69g11LW9Z-YiqjDE6YSeebCWEHa8PVq_mrj0dvnI/s72-c/how-to-install-ember.jpg" height="72" width="72"/><thr:total>0</thr:total></entry></feed>