1

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

1
  • Maybe you can use a file select box together with fileReader (HTML5) to retrieve the content of file immediately Commented Jun 12, 2014 at 10:07

1 Answer 1

1

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>
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.