angularjs-directive

Content-Editable in the angular js

徘徊边缘 提交于 2019-12-21 23:22:50
问题 I have a table as shown below ╔═════╦═════╦═════╦═════╗ ║ A ║ B ║ C ║ D ║ ╠═════╬═════╬═════╬═════╣ ║ abc ║ pqr ║ XYZ ║ RSY ║ ╚═════╩═════╩═════╩═════╝ Now, In this table, I am using a content-editable of HTML5 for the column B . With this, I am able to edit the contents of the column B . Now, Here when I edit this, Is there any way through I will get to know which row has been edited and the value of a column An as well like, suppose I have edited pqr -> aaa then It should be like ╔═════╦═══

has-any-authorithy directive in jhipster application

别说谁变了你拦得住时间么 提交于 2019-12-21 23:02:13
问题 I have created a new role ROLE_SUPERUSER in my jhipster application. I want a specific navbar menu to be visible to only admin and my new user. I tried using has-any-authorithy as given in authority.directive.js but its not working. I am using it in HTML like has-any-authorithy="['ROLE_ADMIN','ROLE_SUPERUSER']" Am I missing anything? 回答1: Code says: authorities = attrs.hasAnyAuthority.replace(/\s+/g, '').split(','); So it seems that the directive expects one string and not an array. Try this:

Get uploaded file from Dropzone

独自空忆成欢 提交于 2019-12-21 22:14:52
问题 I have a Web API method to upload file and return FileResult object that contains file path. How can I get the file path of uploaded file in dropzone (how to get response from Web API method)? My dropzone: module.directive("dzDirective", [ 'apiAttachment', function(apiAttachment) { return { restrict: "A", link: function(scope, iElement, iAttrs, controller) { iElement.dropzone({ url:"/api/1/FileTransfer", uploadMultiple: false, init: function() { var myDropzone = this; myDropzone.on("complete"

Directive to add ng-pattern attribute

▼魔方 西西 提交于 2019-12-21 21:29:35
问题 I am trying to create a directive that will replace itself with the ng-pattern attribute. The attribute gets applied to the input element but the element basically becomes unusable after that. I can no longer enter characters into the text box. Here is the plunkr http://plnkr.co/edit/F6ZQYzxd8Y04Kz8xQmnZ?p=preview I think I must be compiling the element incorrectly after the attribute is added. app.directive('passwordPattern', ['$compile', function($compile){ return{ compile: function

Set attribute value of angular directive from another controller

怎甘沉沦 提交于 2019-12-21 17:44:49
问题 Angular directive; .directive('ngFilemanager', function () { return { restrict: 'EA', scope: { thefilter: '=', }, link: function (scope, element, attrs) { }, templateUrl: '/templates/filemanager.html', controller: FileManagerController } Html: <div id="testcontainer" ng-controller="OtherController"> ... <div ng-click="vm.myfunction">Set Filter</div> ... <div id="thefilemanager" ng-filemanager thefilter=""></div> ... </div> How can i set thefilter value in a function of OtherController ? I

Angular ui tab with seperate controllers for each tab

Deadly 提交于 2019-12-21 13:07:37
问题 I would like to make a bootstrap tabset with each tab having it's own controller. Can anyone point me in which direction I should go. Currently I have made several difference controllers, which I would like to be used in a tabset instead of having them displayed as a different route. I know I could fake it by having the tabset in the difference controller templates displaying the given controllers tab as active, but I would like to be able to have a main TabController with several child

Can I use Angular variables as the source of an audio tag?

僤鯓⒐⒋嵵緔 提交于 2019-12-21 13:03:09
问题 I am trying to do the following: <div ng-repeat="audio in event.audios"> <audio ng-src="/data/media/{{audio}}" controls></audio> </div> But when I load the view, the {{audio}} variable is not parsed but hardcoded into the source as is. However, if for example, I place that same variable outside of the audio tag it renders the name of the audio file correctly. I've tried using both src and ng-src to no avail. Is there a way to get the variable to work within an audio tag? Thanks in advance.

How to add attributes of element to angular directive

断了今生、忘了曾经 提交于 2019-12-21 12:49:53
问题 I'm new to angular. I want to write a directive which has all the attributes that I added to it when using in html. For example: This is my directive 'use strict'; app.directive('province', function($compile) { return { restrict: 'E', link: function (scope, element, attrs, controller) { var markup = "<select></select>"; var elem = angular.element(element); elem.replaceWith($compile(markup)(scope)); } }; }) HTML: <province class="form-control" data-target"elemntId"></province> I want my

AngularJS Directive for ElevateZoom jQuery Plugin

你。 提交于 2019-12-21 12:12:44
问题 I'm trying to use the ElevateZoom jQuery plugin inside an angular app. Essentially, to use ElevateZoom normally, you create an image as follows: <img id="my-img" src="small.jpg" data-zoom-image="big.jpg" /> Then in your application JS: $('#my-img').elevateZoom(options); This works fine in a standard app. But when I try and do it in my AngularJS app using a directive (I followed some SO answers for getting jquery plugins into angular with directives) I just can't make it work. Live editable

how to set dynamically height to element?

Deadly 提交于 2019-12-21 07:35:25
问题 I am trying to set dynamically height to element in my demo .I will tell you issue I am taking static or constant value of height in my demo .I take 250px constant value #wrapper{ background-image: url(https://dl.dropboxusercontent.com/s/nz1fzunlqzzz7uo/login_bg.png?dl=0); min-height: 250px; background-repeat: no-repeat; } But I need to add this height dynamically .I got height from this $scope.hgt =$window.innerHeight/3; alert($scope.hgt) But I need to set $scope.hgt to min-height to