Read from properties file stored in system in agularjs


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


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

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

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

another is reading properties file in spring

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


There is currently no discussion for this recipe.

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