Tuesday, 23 December 2014

AngulaJS $timeout example

$scope.statusMessage = true;
          $timeout(function() {
              $scope.statusMessage = true;
          }, 2000); 

Saturday, 20 December 2014

Clone all branches with Git


clone project by 
git clone git://example.com/myproject

navigate project directory 
$ cd myproject

Check All branches
git branch -a

check out as
git checkout branchname

do like 
$ gitk --all &

to get all branch 

REF : http://stackoverflow.com/questions/67699/clone-all-remote-branches-with-git

GIT Checkout with different

check out from branch somebranchname

git fetch && git checkout somebranchname

Merge GIT branch[es] to Master branch


git checkout master
git pull
git checkout yourBranch
git merge master

Tuesday, 16 December 2014

Get Image Dimension Before upload with angularjs

var _URL = window.URL || window.webkitURL;
         
var image, file;

          if ((file = $files[0])) {
            image = new Image();
            image.onload = function() {
                $scope.$apply(function() {
                  alert(image.width);
                });
            };

image.src = _URL.createObjectURL(file);

Monday, 15 September 2014

AngularJS project with YeoMan windows 7 step by step


  1. Download Node.js 
    1. install it
  2. Download Git
    1. install it
      1. Run Git form the Windows Command Prompt
      2. Configuring the line ending conversions“, choose “Checkout Windows-style, commit Unix-style line endings”
  3. Download Ruby
    1. Install it
  4. Open Command prompt
    1. Check Git command 
    2. Check Node.js
    3. if all work proper than fire few command as
      1. npm install -g yo
      2. npm install -g grunt-cli bower
      3. npm install -g generator-webapp
      4. npm install -g generator-angular
      5. note : now installation has been done these all steps are mendetory only once for your system
    4. create project directory
      1. mkdir yoeman-angular-project
      2. cd yoeman-angular-project
      3. yo angular yoeman-angular-project : for creating project and select all dependency as you required for project
      4. grunt serve --force : to start server it will open index.htm page in browser to indicate your app is running

Wednesday, 10 September 2014

JQuery AJAX call for web services / jsp / asp.net page

with out data 
       $.ajax({
            type: "POST",
            url: " web services / jsp / asp.net page",
            dataType: "text",
            async:false,
            contentType: "application/json; charset=utf-8",
            success: function (data) {
                Success = true;//doesnt goes here
            },
            error: function (textStatus, errorThrown) {
                Success = false;//doesnt goes here
            }

        });
with passing data on server
        $.ajax({
            type: "POST",
            url: " web services / jsp / asp.net page",
            dataType: "text",
            async:false,
            data: JSON.stringify({ json object }),

            contentType: "application/json; charset=utf-8",
            success: function (data) {
                Success = true;//doesnt goes here
            },
            error: function (textStatus, errorThrown) {
                Success = false;//doesnt goes here
            }

        });

            

Working with checkbox with JQuery

Vereion 1.6 +
$('#myCheckbox').prop('checked', true);
Vestion 1.5
$('#myCheckbox').attr('checked', true);

Conver JSON object to String in JQuery

JSON.stringify(jsonObject);

Jquery Input button enable / disable

version 1.6 + 

$("input").prop('disabled', true);
version 1.5 
$("input").attr('disabled','disabled');