created controller for angularjs