angularjs-directive

Parent/child click relationships in AngularJS directives

旧街凉风 提交于 2019-12-12 03:07:53
问题 I have a custom directive placed on a Kendo UI treeview widget. It seems to be working fine side-by-side, except that I'm trying to simply display the custom icons next to the tree node which is clicked on (see sample image below). So my directive is data-toggle-me , placed next to the Kendo k-template directive as follows : <div class="reports-tree" kendo-tree-view="nav.treeview" k-options="nav.treeOptions" k-data-source="nav.reportsTreeDataSource" k-on-change="nav.onTreeSelect(dataItem)" >

Transcluded element not being deleted on removal of list item when using ng-repeat

我只是一个虾纸丫 提交于 2019-12-12 02:59:59
问题 I have a widget that I'm instantiating using ng-repeat . Initial creation works fine, but after that it stops updating. Here's an excerpt from index.html : <div> <x-node ng-repeat="node in nodes"></x-node> </div> partials/node.html: <div>{{node.name}}</div> And the directive: angular.module('directive', []).directive('node', function() { return { restrict: 'E', scope: true, templateUrl: 'partials/node.html', replace: true, compile: function(tElement, tAttrs, transclude) { return { post:

AngularJS directive with $http requests (inprog error)

落爺英雄遲暮 提交于 2019-12-12 02:55:32
问题 I've searched and tried many things for this, and I think maybe Im just doing it wrong. I have a single page app that has very similar DOM pieces, differentiated only by the data that is fed in to them from a service. Each DOM piece has a different web service. My HTML looks something like this <div section="foo"> <ul> <li ng-repeat="item in collection">{{item.name}}</li> </ul> </div> <div section="bar"> <ul> <li ng-repeat="item in collection">{{item.cost}}</li> </ul> </div> The differences

Unable to drag and drop with angular js

╄→гoц情女王★ 提交于 2019-12-12 02:53:30
问题 I am newbie to angularjs . currently I am working with a project for drag and drop but with pure jquery ui I am able to drag and drop but whenever I am going to include this with angularjs then I am unable to drag Here is the jsfiddle for what I have done How can I inclucde with jquery ui with angularjs Update : Here is the jsfiddle for drag and drop with pure jquery ui http://jsfiddle.net/ucerturohit/zHZxp/ 回答1: You need an extra library to make drag and drop work with angular js. There are

how to deploy angularjs app using webpack after uglify on heroku

青春壹個敷衍的年華 提交于 2019-12-12 02:39:51
问题 I need to deploy an angularjs app. after I used webpack to uglify the production app. The below commands appeared. The app is working fine when I run webpack-dev-server Hash: 06f0e2d056b597c4e43f Version: webpack 1.13.2 Time: 16533ms Asset Size Chunks Chunk Names bundle.js 4.37 MB 0 [emitted] main [0] multi main 28 bytes {0} [built] [13] ./src/index.js 2.69 kB {0} [built] + 12 hidden modules WARNING in bundle.js from UglifyJs Side effects in initialization of unused variable $element [./~

D3plus boxplots don't appear when I use Angular's directive angular-d3plus

馋奶兔 提交于 2019-12-12 02:39:30
问题 This post is a follow up of: I am trying to inject a partial template in Angular that contains a graph Essentially, I have an Angular app, and I am trying to inject a partial template called "employees.html" when I click "employee" on a dropdown menu. Thanks to previous answers, I can call a d3plus boxplot with an Angualr controller (angular-d3plus.js: https://github.com/mariohmol/angular-d3plus) . I am using the box demo: http://codepen.io/mariomol/pen/vGNQaV just to make it first work.

Directive's code fires before I got data

谁说我不能喝 提交于 2019-12-12 02:36:56
问题 This is continuation of this question Get other columns from select ng-options I have the problems with my directive. First problem is that with the very first initial load of the form I can see correctly department and category, but item shows 'Select Item' instead of the item. The second problem is when I navigate to another row in the list, the initial values are not shown (e.g. everything is showing 'Select Department', 'Select Category', 'Select Item' instead of the values. I confirmed

Insert directive into the DOM using jqlite

淺唱寂寞╮ 提交于 2019-12-12 02:19:22
问题 I need to use jqlite to insert the HTML for the directive, but for some reason the directive does not insert the template. <div ng-app="docsSimpleDirective"> <div ng-controller="Controller"> <button ng-click="showCustomer($event)">click to see the customer</button> <div> </div> And my app.js looks like: angular.module('docsSimpleDirective', []) .controller('Controller', ['$scope', function ($scope) { $scope.customer = { name: 'Naomi', address: '1600 Amphitheatre' }; $scope.showCustomer =

AngularJS - ng-click in directive's link function

人走茶凉 提交于 2019-12-12 02:14:23
问题 I'm working on a directive, and in the link function, while iterating over a array model, want to append elements to the page with ng-click handlers attached to them. Something like this: app.directive('foo', function(){ restrict: 'A', link: function(scope, elem){ ... // some logic for (var i = 1; i < numberOfPages + 1; i++) { elem.append('<li ng-click="bar('+i+')">'+i+'</li>'); } } }); But the ng-click handlers are dead on arrival. How can I make the handlers behave as expected? 回答1: In

AngularJS factory placement

[亡魂溺海] 提交于 2019-12-12 02:07:00
问题 i have this lightbox that pops up from time to time. There are 3 ways to close it. Close button, clicking the overlay that's outside it and another way. For the close action i decided to do a factory that looks like this: app.factory('close',function(){ return { close: function(){ $('.mySelector').fadeOut(); } } }); One of my HTML elements that i want to have close the lightbox would be something like this: <a href="" ng-click="close">close lightbox</a> The question i am faced with is this: