Tuesday 8 October 2013

How to use sugar.js file in Appcelerator ?

// Sugar.js file is very useful in our developing process .

// Today I create one sample  code which contain sugar.js file and it help me a lot.

// Sugar is a Javascript library that extends native objects with helpful methods. It is designed to be intuitive, unobtrusive, and let you do more with less code.

// Sugar provides methods on strings like from, to, first, last, add, and remove to make modifying strings intuitive and readable, as well as others like each, chars, words, lines, paragraphs which allow iterating over chunks of text. Common escaping methods like escapeURL, escapeHTML, and escapeRegExp provide quick shortcuts for string escaping. Multilingual support is also enhanced with shortcut methods to Unicode script blocks, such as Kanji (Chinese and Japanese), Hiragana (Japanese), Hangul (Korean), Greek, Hebrew, and more. 

// sugar gives the Date class much love starting with the Date.create method which can understand dates in just about any format in 15 major languages, including relative formats like "1 hour ago".

// I create one sample project in appcelerator and i really happy to use this file .

And that project is available on Git. :)

https://github.com/dharmik/use-of-sugar.js-file

Helpful Link : )

sugarjs.com

 I hope this code helps you and solve your some problems. :)


No comments:

Post a Comment