Questions tagged [angularjs-interpolate]

Compiles a string with markup into an interpolation function. This service is used by the HTML compile service for data binding. See interpolateProvider for configuring the interpolation markup.

Compiles a string with markup into an interpolation function. This service is used by the HTML compile service for data binding. See interpolateProvider for configuring the interpolation markup.

51 questions
14
votes
6 answers

Angular calculate percentage in the HTML

I am trying to display a percentage value in my HTML as follows: {{ ((myvalue/totalvalue)*100) }}% It works but sometimes it gives a very long decimal which looks weird. How do I round it off to 2 digits after the decimal? Is there a…
Abhishek
  • 2,998
  • 9
  • 42
  • 93
6
votes
1 answer

how to url encode expressions of template variable with $interpolate?

I have a variable x = "http://example.com?a={{a}}&b={{b}} This variable is then used in a ng-src={{x}} Therefore it is important for me to url encode the variables a and b. What i do currently is: var func = $interpolate($scope.x); …
David Michael Gang
  • 7,107
  • 8
  • 53
  • 98
6
votes
2 answers

ng-bind-html vs {{interpolation}}

That is my question, what are the pros and cons ? In my app I am using interpolation but I get errors like this {{::sport.name}} -> NHL Futures & Props and if I use ng-bind-html ng-bind-html="sport.name" -> NHL Futures & Props in this case…
Non
  • 8,409
  • 20
  • 71
  • 123
5
votes
1 answer

Change Interpolation symbols in angular5

Building a project in angular5 where I want to use [[ ]] for interpolation as start and end symbol. Previously , Angularjs1.x has $interpolateProvider to customize these symbols, by default interpolation symbol is {{}} . How can we achieve the…
Anil Arya
  • 3,100
  • 7
  • 43
  • 69
4
votes
2 answers

Is it possible to set a default value in an AngularJS expression?

I have an AngularJS expression enwrapped in a tag. The expression is evaluating an allow variable. {{allow}} In case allow is null or undefined Angular shows nothing. Instead I would like to display a default string. To give…
Sagar Sinha
  • 375
  • 2
  • 8
  • 26
4
votes
2 answers

Playing with placeholder in Angular

Is there like a kind of ng-placeholder or something similar ? I want to put a default placeholder which is Risk, that is for an input which is a calculation input, sometimes the calculation last 2 seconds, so I want to remove that Risk placeholder…
Non
  • 8,409
  • 20
  • 71
  • 123
4
votes
1 answer

Angular interpolation, ng-bind and ng-translate unexpected behaviour

I am seeing unexpected behaviour differences when using Angular interpolation {{ blah }} as opposed to ng-bind='blah' when using ng-translate. So given a really simple controller with $scope.name = "Angular" the following works perfectly using…
steve
  • 3,230
  • 1
  • 19
  • 14
2
votes
1 answer

Ionic 2 passing data from to in the same html

I have a html page in Ionic 2 where I am generating ion-slide using *ngFor and I want to pass the data from ngFor to the footer in the same page.
Suneet Jain
  • 216
  • 1
  • 3
  • 17
2
votes
1 answer

InterpolateProvider in angularjs 2

I'm trying to do something similar to this interpolateProvider in AngularJS 2 but can not find how to do this similarly for $interpolateProvider.startSymbol('[['); $interpolateProvider.endSymbol(']]');
Hemant
  • 31
  • 1
2
votes
1 answer

$interpolate values from a ng-repeat created scope

A follow up to this question: AngularJS data bind in ng-bind-html? What if the values which I want to interpolate are attached to a ng-repeat created scope? myDict = {'Suggestion' : $interpolate('Vote here if you think {{player.name}} is…
2
votes
0 answers

Want to use multiple ng-app within one application

I am working on an application, Where multiple ng-app are defined and used. Initially ng-app on different pages were not conflicting as all the pages were independent but now I have to include a header and header has its own ng-app defined. I am…
Always_a_learner
  • 4,585
  • 13
  • 63
  • 112
2
votes
3 answers

What is wrong with this angular code?

This is the code that I am using to get images: But it wont fetch the image. it only gets the file path but not the product image name.
2
votes
2 answers

How to prevent AngularJS interpolation on a div?

Is there a way to prevent interpolation on a div? I want to grab the raw html from it and interpolate manually by injecting $interpolate like this: $scope.report = $interpolate($("#myDiv").html())($scope);
adam0101
  • 29,096
  • 21
  • 96
  • 174
1
vote
0 answers

Accepting html safely in angularjs

I need to accept html input (template) from user. I need to then compile it using angular's $interpolate function. So when I get the html from user, I do this. let $interpolate = this.$injector.get('$interpolate'); let $sanitize =…
Ganesh Nemade
  • 1,504
  • 12
  • 17
1
vote
1 answer

How to use an object that is filtered by its properties in angular controller?

I am illustrating a stacked graph along with its table and fetching its json data with $http.get() and setting it to $scope.dataset html: I…
DragonKnight
  • 1,740
  • 2
  • 22
  • 35
1
2 3 4