Questions tagged [angularjs-compile]

Compiles an HTML string or DOM into a template and produces a template function, which can then be used to link scope and the template together.

Compiles an HTML string or DOM into a template and produces a template function, which can then be used to link scope and the template together.

The compilation is a process of walking the DOM tree and matching DOM elements to directives.

Reference:
$compile

145 questions
0
votes
1 answer

Transclude does not interpolate

I have a directive that transcludes some HTML to provide a faux context menu. The usage is as such:
0
votes
2 answers

angularjs partial view with controller(javascript)

following code create error like this Uncaught Error: [ng:areq] http://errors.angularjs.org/1.3.15/ng/areq?p0=subCtrl&p1=not%20a%20function%2C%20got%20undefined how can i fix it? sample code…
ririzplus
  • 13
  • 3
0
votes
0 answers

Binding HTML template to data in AngularJS

I have a simple HTML template like following

{{data.id}}

And can I just compile it with a data object to a string, I do not want to bind it with any scope. Like var data = {id:123}; var result = $compile(html)(data); Thanks! Added Plunker…
kdu
  • 1,259
  • 4
  • 12
  • 18
0
votes
1 answer

unable to form the view using ng-repeat through custom directive template compilation

I am facing problem in representing ng-repeat in template for custom directive compilation. Please find my plunker http://plnkr.co/edit/5A5oZf5kwBezB4mqZ56C?p=preview. Here even though the question is appearing but the options are not appearing. I…
0
votes
2 answers

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
0
votes
2 answers

Access attributes of compiled directive

I'm building a dashboard component to allow users to add widgets that expose various metrics of the underlying database. Each widget is a distinct directive. In order to properly size the widget in the dashboard, I need to access a property defined…
0
votes
2 answers

Compiling dynamically generated buttons in Angular

I'm trying to dynamically generate a button in Angular. On click, that button needs to call the deleteRow() function and pass in a username. The applicable username is successfully passed to the controller and the resulting button code appears to be…
KBert
  • 3
  • 2
0
votes
2 answers

Failing to load html file dynamically and parsing all angularjs directives in html file

So I have a website set up and I wish to dynamically load other .html files into a div. Each .html file contains some content but 1 .html file contains its own angularjs directives. I was using ng-bind-html along with $scope.content =…
Mo Beigi
  • 1,614
  • 4
  • 29
  • 50
0
votes
1 answer

Why does using $compile make factory execute multiple times

In my code i need to compile html returned from another api from inside a javascript callback function. The following is a simplified version of my code. I am using a factory method which recomplies any element using $compile and $rootScope. The…
0
votes
1 answer

Why do I need $compile when `compile:` seems to work fine

Check out http://jsfiddle.net/3jvoL4ew/ (Note: I know it can be done with a template:, that's not my question though) It contains a directive that adds a button and a text to the element it is used on: app.directive("otcDynamic", function ($compile)…
IttayD
  • 28,271
  • 28
  • 124
  • 178
0
votes
1 answer

AngularJS Template Replace directive not working

I have a templating directive that is almost working the way I want, simple version works :-
text replaced
expands to
steve
  • 3,230
  • 1
  • 19
  • 14
0
votes
0 answers

angular ng-src doesn't refresh an image

I am doing a functionality of selecting an image from the image list. I have a button "select" from every button and call selectImage method on button-click. AngularApp: app = angular.module("BlogImageApp",…
0
votes
1 answer

AngularJs stops working after pjax

I am using both AngularJs and Pjax on the page. After a part of my page is reloaded with Pjax, Angularjs stops working there. Simple {{ 2+2 }} works everywhere except the part, reloaded with pjax. I have found, that the problem is in using…
0
votes
1 answer

In Angularjs, how to ensure template compilation with dynamic model names only after completing all the promises in the for loop

I am using Angularjs and c3 charts directives. My template compilation code is angular.element(document.body).append($compile(template)($scope)); I want this template compilation code to be executed only after all the promises inside the for…
0
votes
1 answer

Link compile html in ng-repeat

I have been searching for hours on this problem, and I can't seem to wrap my mind around a solution here. I am attempting to create a directive that should be able to render a functional bit of HTML. I thought that running the HTML through the…
Scottie
  • 11,050
  • 19
  • 68
  • 109
1 2 3
9
10