Skip to content

Tag: angularjs

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 …

Angular making pseudo-synchronous HTTP requests

I want to construct a mechanism that would access a database via POST requests. So far, I do received the desired data, but am have issues with the timing. Here are three pieces of code that I’m using (simplified to keep the focus of the question). First, a factory handling the HTTP request vis-à-vis a …

How to get a node by index in ag-grid?

AgGrid expects node(s) to be passed in to lot of it’s data functions. How do you get a node by index? Look at the snip below: I can pass the node parameter to refreshRows() function since I’m getting it through forEachNode(). How do you get a node by index without iterating through forEachNode() ?…

Time conversion Not working properly?

I am using the ionic time picker in my project. When I select the time picker it passes a value to the controller. For example when I select 09:00pm, the console shows 79200. If I select 07:00pm the console shows 68400. I want to convert the value to 12 hrs format. I have followed some steps, but it’s n…