Resources

Creating and using AngularJS resources.

   if (result > 100) {
   } else {
   function <function name>(){
      return <directive structure>
      }
   }
});

<directive name> – when declaring an AngularJS directive, the naming convention is camelCase.
For example, we would define the name of the directive as navigateTo. However, when you go to use the directive in your HTML, it will be the dash-separated version. That is, our widget would be <navigate-to> and not <navigateTo>.
<directive structure> – is a JSON.
For example: