Skip to content

Author: admin@master

Get base url in AngularJS

I want to get the base path of my Angular app. Right now I’m doing this: $scope.baseUrl = ‘$location.host() But I only get this: /localhost. My current baseURL is http://localhost:9000/. Answer Try this: $location.$$absUrl console.log(‘$location’,$location.$$absUrl); btw /localhost is …

JavaScript for getting the previous Monday

I would like for the previous Monday to appear in the field where a user enters today’s date. E.g.: If today’s date is entered 29-Jan-16 then the code would make the previous Monday’s date to appear instead (which would be 25-Jan-16). I have seen some code online: However, this is not quite …

How to save and close a bootstrap modal?

This question have many answers out there but none of those answers solved my problem. I have a modal with some <select> tags. I am trying to save the values from the select options. after they click Save the modal should close but not submit the result yet because the user still need to review stuff af…

Identify image paint complete in browser

In case of a high resolution image load in browser, even after network got the image from server. Browser taking some time to display them as it paints gradually. How can I identify this paint job is complete by browser? http://postimg.org/image/txm6e94jz/ – check this image. There image in home page is…