Thursday, February 18, 2016

Java JSON Parser Example with Regex



Recently I came across with problem where I needed to recognize and parse custom exception message inside JSON on Java server side. For that particular problem I used Regex.

The JSON response format is like this:

json-with-exception-message

And this is the code:

Wednesday, February 17, 2016

AngularJS Binding Syntax and Examples


AngularJS bindings cheat sheet:

One-way(data source -> view target):
  • {{expression}}
  • [target] = "expression"
  • bind-target = "expression"

One-way(view target -> data source):
  • (target) = "statement"
  • on-target = "statement"

Two-way:
  • [(target)] = "expression"
  • bindon-target = "expression"

Monday, February 15, 2016

What is Interpolation in AngularJS


Interpolation is such a process when AngularJS fetches a calculated string into the text between HTML element tag and within attribute assignments.

Let's see example of interpolation:

<h3>
   {{title}}
    <img src = "{{myImageUrl}}" >
</h3>