javascript - define function for constants in angularjs -


i'm trying define function hold constant not working

(function(){ 'use strict';  angular     .module('app')     .constant('config1', config1)     .constant('config2',          (function(){             return {                 version: 2             }         }())     );  function config1() {     return {         version: '1'     } };  })(); 

console.log(config1.version); // undefined

console.log(config2.version); // 2

i think u missed config1**()**.version;


Comments

Popular posts from this blog

1111. appearing after print sequence - php -

java - WARN : org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/board/] in DispatcherServlet with name 'appServlet' -

Ruby on Rails, ActiveRecord, Postgres, UTF-8 and ASCII-8BIT encodings -