Wednesday, October 28, 2015

If you are not using ng-bind, instead something like this {{text}}. You might see the actual {{text}} for a second before text is resolved (before the data is loaded).
So you could do something like this<span ng-bind="text"> or <span ng-bind-html="text">

Monday, October 12, 2015

Arrays 

JavaScript arrays are used to store multiple values in a single variable, which can hold more than one value at a time. Arrays are a special type of objects, So typeof operator in JavaScript returns "object" for arrays. Arrays use numbered indexes.  
Example: var names= ["Chanthan", "Jack", "Jhon"];
Arrays use numbers to access its "elements". For this example, names[0] returns Chanthan.

Objects

Objects use names to access its "members". Objects use named indexes.
Example: var person = {firstName:"Chanthan", lastName:"Ratn", age:25};
For this example, person.firstName returns Chanthan.


In array, If you use a named index, JavaScript will redefine the array to a standard object. After that, all array methods and properties will produce incorrect results.
Example:
var size = person.length; // person.length will return 0 
var name= person[0]; // person[0] will return undefined

So how to get the length of a object  in JavaScript object (that is, associative array)
Object.size = function(obj) {
    var size = 0, key;
    for (key in obj) {
        if (obj.hasOwnProperty(key)) size++;
    }
    return size;
};
//get the length of array object
var size = Object.size(array);

So, When to Use Arrays. When to use Objects.
  1. JavaScript doesn't support associative arrays.
  2. Use objects when you want the element names to be strings (text).
  3. Use arrays when you want the element names to be numbers.

Thursday, October 8, 2015

Free and open source, Ionic offers a library of mobile-optimized HTML, CSS and JS components, gestures, and tools for building highly interactive apps. Built with Sass and optimized for AngularJS. more...

Step 1
First you need to install latest nodejs and python then set path variable also.


Step 2
I'm consider windows os. Open the command window and type this
npm install -g cordova ionic
After the installation make sure npm version
 
npm -v


Step 3
Create an Ionic project using one of our ready-made app templates, or a blank one to start fresh.
open command prompt where you like to create your project, then type this
ionic start myApp blank
Or
ionic start myApp tabs
Here I follow tabs app. Open the folder, folder should be like this




Step 4
Make sure your in inside the project folder in command prompt, then to start the app type
ionic serve
Now your app successfully started in your browser.

http://localhost:8100
 
Note: Make sure any servers not running port 8100.

Now we see the project structure, Open app your favorite IDE

Popular Posts

Recent Posts

Unordered List

Text Widget

Powered by Blogger.

Popular Posts