Saturday, March 16, 2013

AngularJs compiling dynamically added dom

Scenario
We have an application where we use angular for a particular tab. So we needed to compile the ajax document.

Wednesday, February 13, 2013

Error Deploying Angular JS

When Deploying Angular JS to rails production server, we were getting the following error,
Error: Unknown provider: eProvider <- e at Error (<anonymous>) ....
Well if you are getting mad to find error in your Angular you can not. Just inject the dependencies as follows,
MyController.$inject = ['$scope']; 
And that is it.

Reference

http://stackoverflow.com/questions/13459452/rails-3-angularjs-minification-does-not-work-in-production-unknown-provider

Monday, February 11, 2013

Ubuntu Teletalk 3G configuration

The basic settings is,
Dial number: *99#
APN Address: gprsunl
PDP Type: IP
Auth mode: PAP
Edit connection -> Mobile Broadband -> Add new ....

Monday, January 14, 2013

Jquery ui datepicker a common gotcha

This post is just to keep me reminding about a jquery datepicker issue.

If you have multiple jqerury ui datepicker with the same html ID, then you are done for. Crazy behavior is observed then. Don't set id to input for datepicker if you have multiple of them, or just assign a new id to each of them.

Tuesday, November 6, 2012

Using class as jquery selector

We are so much used codes such as following,

$('a.mark_locked').live('click', function () {
  // your code goes here
});

Using class as a selector for putting a javascript business logic is kind of evil.
The purpose of class in HTML is for styling. After jquery or prototype came to light, people have been using it for selectors as well. But to me this is not right. I myself used to do this a lot. But not anymore. Because when you hire a designer to change the html or dom then the designer has to know which class to keep and which to change. He does not have a clue which are the classes used for javascript. And for a large project it is a huge issue. Eventually no classes are removed and the HTML dom becomes heavy and clumsy.

A much better approach is to use attribute selector, as following,
$('a[mark_locked]').live('click', function () {
  // your code goes here
});

Now your designer has more freedom for manipulating classes in dom.