Read from properties file stored in system in agularjs

Problem

Could anyone tell me how to read properties file in Angularjs. Property file could be any where in system. I want something like , reading java file by specifying path. Thanks in advance

Problem courtesy of: saurabh

Solution

There are 2 ways. one is reading properties file in angularJs

    var app = angular.module('app', []);

app.controller('test', function ($scope, $http) {
  $http.get('connection.properties').then(function (response) {
    console.log('a is ', response.data.a);
    console.log('b is ', response.data.b);
  });
});

another is reading properties file in spring

  <bean id="messageSource"
  class="org.springframework.context.support.ReloadableResourceBundleMessageSource"    autowire="byName"> 
<property name="basename" value="classpath:messages" /> 
<property name="defaultEncoding" value="UTF-8" /> 
 <property name="cacheSeconds" value="1"/>
</bean>
Solution courtesy of: rishi

Discussion

There is currently no discussion for this recipe.

This recipe can be found in it's original form on Stack Over Flow.