How do you have to be able to use the variable for these purposes?
I'm creating this variable in my Constants.js and calling it in my controller.js as follows:
.controller('mainController', function ($scope, API, $location) {
$scope.baseurl = API.url;
$scope.$on('$routeChangeStart', function (next, current) {
$scope.url_atual = $location.url();
});
});
Constants.js is as follows:
(function() {
'use strict';
angular
.module('app')
.constant('API', {
url: 'http://192.168.110.4/cliente_cliente/em_desenvolvimento/front/bernardo/'
}); })();
One place that works is the links:
<a href="{{baseurl}}#/noticias/interna/#disqus">
One place that does not work is:
<img class="img-responsive" alt="disqus" src="{{baseurl}}app/template/img/icone_face_home.png">
I'd also like to put inside script tags, like low, but I'm not getting it:
var image = {{baseurl}}app/template/img/icone_mapa.png";
And within a css field:
<div class="img_principal_noticia_home" style="background-image: url({{baseurl}}app/template/img/img_baner.jpg)"></div>
And within a ng-click, I also could not (rrsrsrsrs):
<a href="" ng-click="vm.facebook('{{baseurl}}#/noticias/interna')">