What is deep linking in AngularJS?

Here is a clear definition of deep linking from this blog: Deep linking is the usage of the URL, which will take to specific page (content) directly without traversing application from home page. It helps in getting indexed so that these links can be easily searchable by search engines like Google, Yahoo.. etc. Using Angular, … Read more

$apply already in progress error

You are getting this error because you are calling $apply inside an existing digestion cycle. The big question is: why are you calling $apply? You shouldn’t ever need to call $apply unless you are interfacing from a non-Angular event. The existence of $apply usually means I am doing something wrong (unless, again, the $apply happens from a non-Angular event). If $apply really is appropriate … Read more

Simple Popup by using Angular JS

Built a modal popup example using syarul’s jsFiddle link. Here is the updated fiddle. Created an angular directive called modal and used in html. Explanation:- HTML On button click toggleModal() function is called with the button message as parameter. This function toggles the visibility of popup. Any tags that you put inside will show up in … Read more

`ui-router` $stateParams vs. $state.params

The documentation reiterates your findings here: https://github.com/angular-ui/ui-router/wiki/URL-Routing#stateparams-service If my memory serves, $stateParams was introduced later than the original $state.params, and seems to be a simple helper injector to avoid continuously writing $state.params. I doubt there are any best practice guidelines, but context wins out for me. If you simply want access to the params received into the url, then use $stateParams. … Read more

What is .$on() in AngularJS

$on is related to $broadcast and $emit – which is a way to trigger code from other places. The first thing about $on you should know is that it’s a method of $scope The second thing you should know is $ prefix refers to an Angular Method, $$ prefixes refers to angular methods that you should avoid using. Now lets get into detail … Read more

angular.service vs angular.factory

I had trouble wrapping my head around this concept until I put it to myself this way: Service: the function that you write will be new-ed: Factory: the function (constructor) that you write will be invoked: What you do with that is up to you, but there are some useful patterns… Such as writing a service function to expose a public API: Or … Read more

AngularJS BootstrapUI Typeahead with object & selection functionality

The typeahead directive from http://angular-ui.github.io/bootstrap/ is very, very flexible and there are many ways of achieving the desired functionality. I’m presenting 2 of them here. Firstly, the typeahead directive uses syntax very similar to the AngularJS select directive. This gives you full control over a displayed label and the data bound as model value. So what you could do … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)