Monday, September 15, 2014

Update Angular model after setting input value with jQuery

I needed to update my angular model with jquery. But it doesn't seem work from default codes.

So I added following code to manually trigger the value after adding that from jquery.

angular.element($('myInputElement')).triggerHandler('input')

This perfectly worked except for hidden elements.

So I have to remove the hidden element and add it as text field and hide from style.

Ref:
http://stackoverflow.com/questions/17109850/update-angular-model-after-setting-input-value-with-jquery


Sunday, September 14, 2014

Laravel requires Mcrypt php extenstion when installing with composer in MAMP


When I was installing Laravel 4 via composer, it failed at the end because it asked to unable Mcrypt extension in php.

Generally MAMP using its native php. You can find it just type,


which php

in the terminal.

If it returns '/usr/bin/php', that means MAMP using its native php.

You should change it to MAMP's php.


To do it open or create file called '.bash_profile' (used '.' because it is a hidden file) in your home directory.


cd ~
vim .bash_profile
(use vim or other texteditor)


And add this line to it.


export PATH=/Applications/MAMP/bin/php/php5.4.10/bin:$PATH


To make sure what php versions are available, just type


cd /Applications/MAMP/bin/php


It will show all the php versions currently installed. Use latest or your preferred version and add it to above line.


After saving the file, just restart the MAMP and run composer update again in new Terminal window. (Same terminal window will not work.)


References :

http://laravel.com/docs/quick
https://getcomposer.org/doc/03-cli.md#install
http://stackoverflow.com/questions/16830405/laravel-requires-the-mcrypt-php-extension