Skip to main content
Stack Overflow for Teams is now Stack Internal: See how we’re powering the human intelligence layer of enterprise AI. Read more >
Filter by
Sorted by
Tagged with
0 votes
2 answers
165 views

I was doing some javascript coding in chrome's console. When I do: console.log(x); let x; It gives "ReferenceError: x is not defined" But when I run the below code: let x; console.log(x); ...
Akrit's user avatar
  • 99
1 vote
1 answer
255 views

I have a created a component called popupmessage to show custom message with "ok" and "cancel" button. This i am invoking from another component say component "a" using $compile like below. a.js has ...
Rem San's user avatar
  • 407
0 votes
1 answer
167 views

I have a plain angular application which adds variables to the scope and simply display them. Which is simple and working. But there is a part of the page that does not run in angular (practically it ...
Eric Wong's user avatar
  • 1,483
-1 votes
2 answers
45 views

I have a directive that might look like this: a.directive('autoResize', function($compile) { return { scope: {}, link: function(scope, elem) { // HTML here is just an example ...
Mark's user avatar
  • 5,010
1 vote
1 answer
1k views

I am wondering, is it possible to pass an $index param into the ng-transclude? I am trying to focus into the textarea by clicking on the elements in the ng-transclude, triggering a function inside the ...
strwoc's user avatar
  • 533
1 vote
1 answer
149 views

ON MYPENCODE Having the following two directives dragMe and compile : dragMe app.directive('dragMe',['$compile', function ($compile) { return { restrict: 'A', scope:{ book:'='...
Schwertfisch's user avatar
1 vote
1 answer
277 views

I have a big directive with sub-directives where I'm getting the error. Exactly, it happens on the step when calling transcludeFn() in the link function of main directive: var link = function ($...
anatol's user avatar
  • 1,810
1 vote
2 answers
380 views

I have a controller which is populating content to content areas using ng-repeat. The issue is that some of this content needs to come front template files and so needs to be compiled 'on the fly'. ...
Paul's user avatar
  • 2,525
0 votes
2 answers
2k views

I'm new to angularJS and want to implement the efficient thing for my project but got stuck between $onInit (life cycle hook) and activate().
fahad tufail's user avatar
2 votes
0 answers
575 views

I'm trying to compile a HTML that has style and script tags inside it. The HTML is compiled properly and the code is added to the DOM, the style also works, but the script is not executed. Anyone ...
TDT's user avatar
  • 643
0 votes
1 answer
40 views

Background We have an old application written i jQuery and Handlebars and we're migrating part by part to AngularJS (this work began many years ago and was never finished, hence AngularJS). Problem ...
jwanglof's user avatar
  • 547
1 vote
1 answer
815 views

New to AngularJS - I am trying to create a function that finds "tokens" of specific text, replaces them with an ng-click directive bound to a function on the controller. For example, from my database ...
brandondavid's user avatar
2 votes
1 answer
97 views

OK So I created a chat widget that isn't hardcoded instead it it is created by a service for example: $chatWidget.setParent(parent).setUser(user).setMessages(messages).build(); Here is the build ...
RudolphRedNose's user avatar
1 vote
1 answer
378 views

I am using $mdDailog in my angularjs application.I have addUser() function which is called on ng-click operation. Inside addUser() am using $mdDailog.show(). Where I am passing html file path in ...
abhi's user avatar
  • 2,218
0 votes
1 answer
63 views

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) ...
Mouad Ennaciri's user avatar
1 vote
0 answers
22 views

I'm working on a SPA Project. At the header I have a menu template and under the menu I have ui-router routes. I built a functionality with popover of Angular Bootstrap . And I am using built-...
Atlas's user avatar
  • 243
0 votes
1 answer
192 views

I want to create a dashboard comprising of several smaller "apps". I have the following markup (simplified): <div id="rowcontainer"> <div ng-repeat="appRow in dashboard.appRows"> &...
bash.d's user avatar
  • 13.3k
7 votes
1 answer
7k views

I'm trying to dynamically compile an Angular component using $compile, but the scope isn't passed to the components scope, but to the $parent scope instead. Here is a simple component that binds to a ...
Nikolaj Dam Larsen's user avatar
1 vote
3 answers
977 views

$scope.showtbleoption = function(id) { console.log(id); $("#showoption").empty(); $("#showoption").append('<button class="btn btn-info" ng-click="editrc(id)">'); }; how to call ...
Anil's user avatar
  • 63
0 votes
0 answers
65 views

I am a bit confused about the line taken from Angular JS official documentation: Compile: traverse the DOM and collect all of the directives. The result is a linking function. I am not clear about ...
Tisha Anand's user avatar
2 votes
2 answers
462 views

Could anyone help me solve a scoping issue when compiling a directive within ng-repeat? https://plnkr.co/edit/y6gfpe01x3ya8zZ5QQpt?p=preview The custom directive input-by-type can replace a <div&...
oodavid's user avatar
  • 2,356
0 votes
1 answer
101 views

Here's an example which demonstrates the problem described in the title: https://plnkr.co/edit/Xn1qgYftc5YHMsrGj0sh?p=preview Directive code: .directive('translate', function($compile) { return { ...
softzer0's user avatar
  • 465
0 votes
4 answers
161 views

I have displayed the products based on branch and billing account. In the product template, i have a "+" button, if we click on the button, then i'm displaying the particular product id below that ...
Ananth's user avatar
  • 1,582
1 vote
0 answers
91 views

I have a page that contains of widgets. Widget is object with settings & templateUrl where I bind these settings, so I build my page compiling these settings using $compile service via directive. ...
6matko's user avatar
  • 74
1 vote
2 answers
135 views

Please have a look at this example, since it is the best way to explain the problem. In this example if you click the directive link, it does not compile the template, but instead displays it as "{{...
supersan's user avatar
  • 6,201
3 votes
2 answers
21k views

I am really confused with $compile in angularjs. can anyone help me, What use of $compile in angularjs with an example other then in this documentation. https://docs.angularjs.org/api/ng/service/$...
RJV's user avatar
  • 287
0 votes
1 answer
624 views

I'm trying to integrate AngularJS to existing web application. Some of data in application is loaded dynamically via $.ajax() and element.html(data). data can contain html code with javascript code in ...
David E. Veliev's user avatar
0 votes
1 answer
1k views

I have used the directive scope in directive template. I have tried to get the html from template cache which was stored earlier. But the current directive scope is not applied to the directive. I ...
Jeeva J's user avatar
  • 3,263
4 votes
3 answers
811 views

I have a directive that does the following: Adds another directive attribute to the element. Removes its own attribute. Calls $compile() on the element to make AngularJS re-compile the element so the ...
David Smith's user avatar
-1 votes
1 answer
742 views

Using Angular 1.5, I want to use a generic "overlay" component to display other components within a modal. I'd like to pass in other components to be rendered within the overlay. I thought I could ...
shackleton's user avatar
1 vote
1 answer
605 views

I'm using $compile to compile a directive on the fly. What I would like to know is if there is a way to detect when the directive is done compiling (promise?) so that I can append it to the DOM. I ...
Daniel Bonnell's user avatar
2 votes
1 answer
2k views

I am planning to unit test a angular directive using jasmine. My directive looks like this angular.module('xyz.directive').directive('sizeListener', function ($scope) { return { link: function(...
Adithya Puram's user avatar
1 vote
1 answer
271 views

I would like to construct a single page app. When a user clicks on a particular object I would like to replace the current component on the page with another component. The code below is situated in a ...
dillib's user avatar
  • 357
1 vote
1 answer
447 views

Due to performance issue, I would like to be able to simply compile a template piece once, then completely remove all watches etc from it, simply use the final template for display purpose only. I ...
mr1031011's user avatar
  • 3,842
0 votes
0 answers
83 views

<div id="{{tagid}}" ng-repeat="item in arrItem"> {{addCompileTag(item)}} </div> </code> In addCompileTag(item) function, I use id of the div tag is "tagid" to $compile HTML DOM ...
nhatchimai111's user avatar
6 votes
1 answer
649 views

The usual order of execution of compile and link function on nested directives is as below Markup <dir1> <div dir2=""> </div> </dir1> Order of execution 1) compile of ...
Yatin Gera's user avatar
3 votes
1 answer
1k views

I wrote a directive that will render subelements with ng-click directive on them, this is the code I have : DIRECTIVE angular.module('myApp') .directive('popover', [ '$compile', function($...
Vincent Wasteels's user avatar
0 votes
0 answers
1k views

How do I implement this in AngularJS 1.5.4 with TypeScript 1.6.2? Here is the vanilla JavaScript version from the official docs: $compile#example I've found this, but it doesn't work: Angularjs+...
A T's user avatar
  • 14k
1 vote
1 answer
438 views

I am trying to apply $watch on a attribute in the post link function. My code is like this : compile: function(){ return { post:function(scope,element){ scope.$watch('...
user3035998's user avatar
1 vote
1 answer
72 views

I am creating dynamic button and using $compile to bind ng-click event. I am adding two parameters there. Problem is that if the parameter is string and having space in between, Parameter is splitting....
Bhuneshwer's user avatar
4 votes
1 answer
1k views

Is there a way to tell Angular to not compile contents of certain elements? Use case: Angular CMS contains textarea elements that have CKEditor attached. The CKEditor is using the divarea plugin ...
Radu C's user avatar
  • 1,439
0 votes
0 answers
96 views

I'm trying to make a custom tooltip that contains a table populated by ng-repeat. My directive looks like the following: app.directive('picker', function ($compile) { return { restrict: 'A',...
Sharon Dorot's user avatar
4 votes
2 answers
981 views

I've using the excellent Angular UI bootstrap in a large site alongside lots of my own directives. For the sake of neatness I looked for a way of renaming a couple of the uib directives without ...
jonhobbs's user avatar
  • 28.2k
0 votes
1 answer
682 views

I'm trying to replace specific string in my text with inputs with ng-models. I used following code: inlinetext.replace(buffer[x], '<input ng-model="singleQuestion.inlines[' + x + '].checkAnswer" ...
Aleš Chromec's user avatar
0 votes
1 answer
258 views

I am trying to use the external module, angular-ui-codemirror, to display the $element.html() of an enclosing AngularJS directive in a code-formatted block, using nested directive ui-codemirror. If ...
Don Subert's user avatar
  • 2,676
13 votes
1 answer
20k views

I was wondering what is the best way to pass functions down through 2 or more levels of components? There's no simple way of skipping the function wrap when using '&' bindings? Here's an use ...
Hodes's user avatar
  • 895
0 votes
2 answers
285 views

I'm creating a directive which will restrict HTML access if some condition are not met. Unfortunately issue arises when inner directives get called before inner HTML is changed and compiled. Is it ...
skmasq's user avatar
  • 4,521
0 votes
1 answer
595 views

I found a problem in changing html of div: document.getElementsByClassName("lab")[0].setAttribute("ng-bind-html", "binds"); $scope.binds="<h1>run</h1>"; I am setting attribute ng-bind-...
Ahmed Alvi's user avatar
2 votes
0 answers
484 views

I am trying to insert a node dynamically, but the appended html is not getting compiled correctly. This is the code on Fiddle. <body ng-app="app"> <div ng-controller="appController"> ...
Ajith's user avatar
  • 403
3 votes
2 answers
625 views

I'm generating a report with collection of questions. app.controller('reportCtrl', ['$scope','$stateParams', function ($scope, $stateParams) { $scope.questions: [ { questionkey: 1, ...
Arooran's user avatar
  • 637