51 questions
0
votes
2
answers
236
views
prevent running function on backtick angular
i have this syntax on angular(typescript), my problem is when this code runs, its automatically runs clickShowAttachments function, instead i am need to run function when this button clicks ...
${data....
1
vote
1
answer
447
views
Ternary operator and template literals in Angular2+ together causing issues?
I have a simple Angular template that is currently using string concatenation within interpolation as follows:
<h4>{{ myVar.property ? myVar.property + ' IS NOT NULL' : '' }}</h4>
What I ...
0
votes
1
answer
61
views
Data not getting parsed in custom directive for angularjs
I have created a custom directive where i am parsing information using data attribute but value of data attribute is null.
Directive invoke code:
<processInfo data="{{self.processInfo}}" type="...
0
votes
1
answer
153
views
AngularJS interpolation issue with translate service
I have this ternary operator in my html (working correctly)
{{ qp.QP_TRANSFERS === '1' ? qp.QP_TRANSFER_TYPE_NAME + ' transfer' : 'No transfer' }}
I'm using translation service from json objects. ...
0
votes
2
answers
748
views
How to properly interpolate a nested property getter in angualr template?
I'm trying to interpolate an nested property getter into angular html template:
<div class="row">
<div class="col-xs-12">
{{ myObject.myProps.someProperty1 }} -- Not working
</...
0
votes
1
answer
140
views
Can we use angularJS string interpolation ( {{}}) in jquery html function
I want to use angularJs string interpolation inside Jquery html function
$('#existingScoresForWeek').html("<p>{{1 + 1}}</p>");
The above line of code is not printing Result as 2
<div ...
1
vote
0
answers
51
views
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('$...
5
votes
1
answer
717
views
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 ...
0
votes
1
answer
65
views
Angular 1 - Compile ng-if condition into string
I have this string :
this.badge = `<span class="badge">{{ notification}}</span>`
to interpret the {{ notification}} expression I do :
this.badge = this.$interpolate(this.badge)(this)
...
-1
votes
1
answer
102
views
Angular 1/$interpolate - interpolate elements in array
I have this array stateData.submenu :
[
{
"template": "<span>myContacts</span>",
"sref": "contact.list"
},
{
"template": "<span>myProjects</span>",
"sref"...
0
votes
0
answers
97
views
Angular 1/$interpolate - interpolate array
I have this array stateData.submenu :
[
{
"template": "<span translate>myContacts</span>",
"sref": "contact.list"
},
{
"template": "<span ...
0
votes
1
answer
331
views
Compiling interpolation manually
I have a custom directive and rendering that directive using ng-repeat. what I need is I want to compile interpolation before passing into my custom directive.
Find plnkr below
https://plnkr.co/edit/...
2
votes
1
answer
321
views
Ionic 2 passing data from <ion-content> to <ion-footer> 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.
<ion-content>
<ion-slides>
&...
1
vote
1
answer
87
views
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:
<input ng-model="_searchQuery.key1.key2">
<tr ng-...
0
votes
1
answer
1k
views
AngularJS Directive - Error while interpolating
I am discovering the AngularJS directives and I am facing a problem for binding attributes of an object to a template.
I have a list of items of different content type (jpg, mp4) and I am trying to ...
1
vote
2
answers
2k
views
Interpolation in Angular JS
I am trying to understand Interpolation concepts in Angular JS and I have written this code. I am trying to enter a text in input box and based on the template in text area tag it should replace the ...
1
vote
0
answers
131
views
Angular directive as angular-translate value
i'm having an issue trying to get a directive work as a value of a translation. here's what i have
scope.value = '<img class="picture portrait" ng-src="' + url + '"></img>';
scope.key = '...
2
votes
1
answer
856
views
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(']]'...
0
votes
1
answer
558
views
AngularJS - $interpolate vs $filter
In AngularJS, $filter provides a way to format the data we display to the user.
However, $interpolate also allows us to live update a string
of text.
Are $interpolate and $filter related to each ...
1
vote
1
answer
523
views
When to use ngAttr?
Just wanted some clarifications. I was told that you are suppose to use ngAttr when there are interpolated markup. For example:
<div ng-attr-name={{Name}}></div>
I also seen some codes ...
1
vote
0
answers
415
views
Passing angular interpolated ID to function
I have been trying to pass the ID of a SVG element generated by ng-repeat.
each one has a cx, cy, and an id:
$scope.circles = [
{cx:25, cy:40, id:1},
{cx:55, cy:40, id:2},
{cx:75, cy:40, id:3}];
...
2
votes
1
answer
603
views
$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('...
1
vote
4
answers
2k
views
how to use dynamic variables on ng-click angular?
Well, I don't know how I can use "dynamic" variables on ng-click attribute.
In this case, i want update variable from reference in ng-click ng-if etc.
My idea is update variables from reference and ...
1
vote
1
answer
1k
views
Angular2 Interpolation doesn't update on change
In this template:
<label for="condition">Condition</label>
<input type="range" min="0" max="4" name="condition"
[(ngModel)]=&...
1
vote
2
answers
270
views
Controller function getting called twice while using as Interpolation
I have a very simple app where I'm trying to call my controller's function like below
var app=angular.module('test',[])
app.controller('ctrl',function($scope){
$scope.func=function(){
alert('...
0
votes
1
answer
251
views
how to use angular expression with django template - href url
I have following code in my django template :
<li class="item" ng-repeat="(key, value) in products" style=" ">
<a href="{% url 'appname:productdetail' 150 %}" class="icon">View</a&...
2
votes
0
answers
227
views
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 ...
0
votes
1
answer
803
views
Maintain session using Interceptor cookies/ server-sessions
Firstly, apology if this question does not make sense. I am developing code for session management for my mean stack app. From last few days, i found lots of way to implement it which are using either ...
5
votes
2
answers
5k
views
Is it possible to set a default value in an AngularJS expression?
I have an AngularJS expression enwrapped in a <a> tag. The expression is evaluating an allow variable.
<a href="#" >{{allow}}</a>
In case allow is null or undefined Angular shows ...
0
votes
2
answers
136
views
angularjs - how to evaluate value with internal $interpolated expression
I'm looking for suggestions on how to do the following:
I have a 'translation' service to convert keys into a string (for localization). A directive 'local' calls this. It looks like this:
<local&...
0
votes
1
answer
1k
views
ng-click not working with $interpolate on an object
I have a template:
var template = '<div ng-click="sayHello()">{{text}}</div>'
I compile it with my object with:
var obj = {};
obj.text = "Hello!!!";
obj.sayHello = function(){alert("hi!")...
0
votes
2
answers
906
views
How to update angular ng-src with image url returned from factory/controller promise?
In my app I have a controller that takes a user input consisting of a twitter handle from one view and passes it along through my controller into my factory where it is sent through to my backend code ...
2
votes
3
answers
54
views
What is wrong with this angular code?
This is the code that I am using to get images:
<img ng-src="{{url}}{{product.image}}" class="product-image">
But it wont fetch the image.
it only gets the file path but not the product image ...
1
vote
1
answer
523
views
Populating Double Curly Braces Within $sce.trustAsHtml
I have to render a string (item.tabs.review.content), that is parsed into HTML using $sce.trustAsHtml.
The main issue I am having is that within the string are references to an array in the item ...
1
vote
1
answer
469
views
Interpolate in ES6 + Angular 1.4 directive
I am currently trying the 'new' ES6 + Angular combination and got stuck on interpolating a html string in a directive that contains scope bindings.
I have tried the following option:
Current ...
4
votes
2
answers
6k
views
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 ...
6
votes
1
answer
2k
views
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 ...
0
votes
1
answer
141
views
Bind dynamic object value inside multiple lists to HTML by filtering on key
I'm getting a list of sandwich components from the server I'm working with, and they come back like below.
Our sandwich shop has various rules as to what parts can go with what, so most of the ...
0
votes
1
answer
286
views
AngularJS form validation via interpolated pattern
I'm trying to make a simple input that validates only by matching some data in scope, literally:
<ng-form name="fooForm">
<input required
pattern="/{{foo}}/"
ng-model="...
6
votes
2
answers
4k
views
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-...
15
votes
6
answers
61k
views
Angular calculate percentage in the HTML
I am trying to display a percentage value in my HTML as follows:
<td> {{ ((myvalue/totalvalue)*100) }}%</td>
It works but sometimes it gives a very long decimal which looks weird. How do ...
0
votes
2
answers
983
views
AngularJS and Laravel Blade: Module Error when changing the interpolateProvider (Delimiter)
I have a strange problem when combining Laravel 5 (with Blade) and Angular 1.3.
I am experienced with Laravel, but a newbie with Angular. I know that I have to change Angular's delimiters to be able ...
0
votes
1
answer
265
views
Can I use an ng-repeat inside ng-repeat and mingle interpolates?
I've found a couple of other questions of people trying to put ng-repeat inside ng-repeat and that seems doable. But to accomplish what I need to do, I think I also need to put an interpolate from the ...
0
votes
2
answers
955
views
AngularJS : Why can't $interpolate render ng-style?
I have created a drop down input directive, where the user can pass in a template string to set what the list will actually render.
In my example I am passing in <div style="background-color: ...
1
vote
1
answer
1k
views
How to add some HTML code to the DOM with angularJS templates and make AngularJS to interpolate them?
I have some some service. I wanna to debug it and see state of variables in this service. My code is below (explanation below the code):
module.factory('Data', function () {
var current = [], ...
4
votes
1
answer
2k
views
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 =...
0
votes
1
answer
724
views
AngularJS : How to not render an attribute if value is undefined
I have a template used in a directive, looking like :
<tr>
<th ng-repeat="col in tableSpec" st-sort="{{col.sortField}}"></th>
</tr>
The attribute st-sort should not be ...
1
vote
1
answer
3k
views
AngularJS : ng-repeat vs $interpolate
From what I have seen with Angular 2.0, I have a feeling I am going to be using Angular 1.x for a while. It has all the building blocks that I think I need, the only downside is that it does have ...
0
votes
0
answers
259
views
Interpolation error with multiple ng-repeat
I get an interpolation error but only sometimes. I refresh/load page a few hundred times without error or sometimes on first load it appears and shows up again after reloading/empyting cache etc. I ...
2
votes
2
answers
1k
views
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())($...