JSFiddle - React, Tailwind, and code Playground

by Samar Pattanayak

HTML

<div ng-app="myApp">
  <div ng-controller="myController">
    {{name}}
  </div>
</div>

JavaScript

var ang = angular.module("myApp", []);
ang.controller("myController", function($scope) {
  $scope.name = "Angular !!!"
})
ang.config(function($resourceProvider) {
  $resourceProvider.defaults.stripTrailingSlashes = true;
  //also you can set this property in 4th parameter of resource declaration.
})
ang.factory("myResourceFactory", function($resource) {
  return $resource("http://app.com/:id/:name", {
    id: 23,
    name: 'Samar'
    //url will be 'http://app.com/23/Samar'
    //apart from these two parameters , if i we add another one like
    
    //greet : 'salutation'
    // url will be 'http://app.com/23/Samar?greet=salutation'
    
    //if i mention name : '@name1' then this parameter value will be fetched from data property of that corresponding request.
    //data.name1 (Impppppppp !!!!!!!)
    
    
  }, {
    Put: {
      method: 'PUT',
      params: {
        id: 45,
        name: 'baisali'
      },
      isArray: true,
      data: {
        helloworld: 'asdfghjk'
      }
    }
  }, {
    stripTrailingSlashes: false,
    cancellable : true
  })
})