Skip to content

Instantly share code, notes, and snippets.

@indraneelr
indraneelr / angular select box.js
Created November 13, 2013 06:59
selectbox in angular
<select
ng-model="selectedOption"
ng-options="option.name for option in options">
</select>
or
<select
ng-model="selectedOption"
Session session = factory.openSession();
Transaction tx = null;
try {
tx = session.beginTransaction();
// do some work
...
tx.commit();
}
catch (Exception e) {
//to iterate over form controls in $form
foreach(element_children($form) as $key) {
$form[$key]['#attributes']['class'][] = 'vr-paragraphs';
}
@indraneelr
indraneelr / angular apply example.js
Created October 18, 2013 15:00
angularjs - samples
// respond to a Bootstrap carousel "slid" event
$('#my-carousel').on('slid', '.carousel', function() {
// first, since we're outside AngularJS, we need to grab
// the AngularJS scope that this element resides in
var scope = angular.element(this).scope();
// next, we find the active item in the carousel, and grab
// some data-* from it
var active = $(this).find('.active');
var description = active.attr('data-description');
@indraneelr
indraneelr / 0_reuse_code.js
Created October 18, 2013 14:57
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console