Comments (2)
Hi @wuethrich44, I was having a similar problem but managed to get the information from the envServiceProvider
which has the same API as the envService
. See this snippet:
app.config(function ($stateProvider, $urlRouterProvider, envServiceProvider) {
envServiceProvider.config({
domains: {
development: ['localhost']
},
vars: {
development: {
API_URL: 'http://localhost:5000',
}
}
});
envServiceProvider.check();
$stateProvider
.state('home', {
url: '/',
templateUrl: 'app/home/home.tpl.html'
})
.state('account', {
url: '/account',
templateUrl: 'app/account/account.tpl.html',
controller: 'AccountCtrl',
data: {requiredLogin: true}
})
.state('login', {
url: '/login',
templateUrl: 'app/account/login.tpl.html',
controller: 'AccountCtrl',
data: {requiredLogout: true}
});
$urlRouterProvider.otherwise('/');
envServiceProvider.get() // returns 'development' when running locally.
envServiceProvider.read('API_URL') // return 'http://localhost:5000'
});
from angular-environment.
Hello @wuethrich44, first of all, sorry for the delay. I'm afraid it's not possible to use envService
within config since the module it self is being used for initialization into de Angular app. I'll try to find a workaround for this issue and I'll let you know.
Cheers!
from angular-environment.
Related Issues (20)
- Use envService in factory section HOT 3
- domain name HOT 2
- Causing errors in Jasmine test HOT 1
- Configuring protocols... HOT 1
- Unit tests HOT 3
- domain issue, www and without
- Request: Support a 'defaults' set in config vars HOT 5
- Subdomains HOT 4
- How to use it with routes? HOT 2
- env check switches to development all the time HOT 5
- Angular environment returning development HOT 7
- Syntax error in "full example" HOT 1
- check() not matching correctly HOT 4
- How to use this plugin when my angular app is running on node
- console.log(v.domain); HOT 5
- Defaults block is not actually the default HOT 2
- prueba notificacion
- Cannot read properties of undefined (reading 'development')
- `npm install` does not pull down index.js HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from angular-environment.