Skip to content
Yash edited this page Nov 3, 2018 · 6 revisions

Spring References Documents:

Angular

$http({
    method: 'POST',
    url: 'myUri', 
    data: { param1: 'value1', param2: JSON.stringify(objJSON) },
    // data: $httpParamSerializerJQLike(json-form-data),
    headers: { 'Content-Type': 'application/x-www-form-urlencoded' }
}).then(
    function(res) {
        console.log('succes !', res.data);
        deferred.resolve(res.data);
    },
    function(err) {
        console.log('error...', err);
        deferred.resolve(err);
    }
);

/*    }).success(function(data, status, headers, config) {

    }).error(function(data, status, headers, config) {

    });*/

//Angular
this.http.post('/api', urlSearchParams)
.subscribe(
      data => {
        alert('ok');
      },
      error => {
        console.log(JSON.stringify(error.json()));
      }
    )
Spring IOC Object creation
 * SingleTon
 * prototype
bean.getBean(); // T1 thread, hold object for 1min
bean.getBean(); // T2 thread check object same for single ton & new object for prototype.

Clone this wiki locally