Angular directive loading order - angularjs

I am using Packery in a directive as in the example here
Packery angular directive
enter code here
I am also creating dynamic elements as described here angular dynamic templates
in which I wish to apply the directive to however I believe the packery directive is loaded before the dynamic template gallery so the new content is not working with packery , I am looking for a way to ensure the dynamic content works with the packery directive

Related

Custom directive not working inside an ng-repeat

I needed an circle progress indicator within cells of a table, which is rendered through an ng-repeat. So, I used an angular plugin, Which is an basically angular directive. When i use this directive within an ng-repeated div, those directive aren't compiling correctly. And, the directive is working correct, if there is no ng-repeat. Click here to view an plunker, demonstrating above issue..

Angular UI Bootstrap scope variables in custom typeahead template

I am using UI Bootstrap's typeahead directive, and added my own popup template via typeahead-popup-template-url. In that template, I'd like to access scope variables from the parent template (i.e. the one in which I've used the typeahead directive). Is this possible?
Here's a (broken) example of what I'm trying to do ("hello" should be present in the dropdown): http://plnkr.co/edit/ITT1SdRfUWeeN6n3aMqu?p=preview
I'd like to do this WITHOUT modifying the typeahead directive. I don't want to muck around in third party (uib) code if there's a more elegant solution.
In your template, you need to reference the $parent scope. Change:
This should say "hello": {{hello}}</h1>
To:
This should say "hello": {{$parent.hello}}</h1>
Bootstrap, jquery ui, kendoui, yui etc
Isn't that a bit much of frameworks together O.o
Anyway this post might help: How to access parent scope from within a custom directive *with own scope* in AngularJS?

Can I use a AngularJs template in a kendo multiselect itemTemplate and tagTemplate?

I have an AngularJs template that I would like to re-use with my Kendo Multiselect Item Template and Tag Template.
Is there any way to do this? I'm not sure how to pass data. When I just try to use AngularJS templates, it doesn't work.
Kendo UI templates are just a javascript functions which accepts single parameter - objects to render and return rendered html.
AngularJS template is an HTML fragment which is rendered by $compile service and stored by $templateCache.
It is theretically possible but hard way.

AngularStrap tabs load html fragment

I am currently working on an AngularJS project with Twitter Bootstrap, and am trying to shift my Bootstrap directives into Angular. I decided on AngularStrap as it provided support for Bootstrap-Select (which I wasn't sure was the same for AngularUI). The tabs example only covered static html though. Is there any way via AngularStrap or AngularJS to load html fragments dynamically, so that it is only called when the tab is clicked? My html fragments need to execute javascript as well.
My reason for doing so is two-fold. First is that each tab contains quite a lot of content, and I do not wish to load all the tabs at once, which will slow down the loading. The second reason is that I prefer a more modular approach to my source code and not put everything on the same html file.
You can use the ng-include directive to load html fragments.
Using the AngularStrap Tab's example you can switch out the static content with the url to retrieve the html fragment. Here is an example based on the AngularStrap Tab example with these key changes:
1) $scope.tabs now has a page property instead of content pointing to either template1.html, template2.html, or template3.html.
$scope.tabs = [
{title:'Home', page: 'template1.html'},
{title:'Profile', page: 'template2.html'},
{title:'About', page: 'template3.html'}
];
2) An ng-include is added to display the currently selected tab's page.
<div ng-include src="tabs[tabs.activeTab].page"></div>
Note: I have the ng-include outside of the ng-repeat so each tab's page contents won't be loaded (even if not displayed).

Adding angular js attribute after page render

I have an application that contains a div with content in it. When I click a button jQuery adds a AngularJs directive to the div. After adding the directive i call scope.$apply(), but this doesn't seem to inform angular about the new directive on the div. Can someone explain to me how I can inform AngularJs about the new directive added with jQuery?
You shouldn't be adding directives to your markup with JQuery. Use Angular for that whenever possible.
That said, if you have to add directives via straight DOM manipulations like that, you'll need to use the $compile provider to compile the element and bind it to a scope before you add it.

Resources