angularjs-directive

how to know which element is selected in angular js

强颜欢笑 提交于 2019-12-11 10:48:57
问题 I make multiple selected popover , in which user can select multiple values . I want to print the all selected value on screen or get a object in which all element which is selected by user .I will explain in other words .In my demo I have one button on screen .On button click I open a pop over which have multiple selected element I want to get all element which is selected by user in pop up please check my demo .here is my demo http://codepen.io/anon/pen/KpaejV angular.module('ionicApp', [

Testing window.postMessage directive

混江龙づ霸主 提交于 2019-12-11 10:39:28
问题 I'm having trouble testing my directive which enables cross-document messaging by registering a message handler: .directive('messaging', function ($window, MyService) { return { link: function () { angular.element($window).on('message', MyService.handleMessage); } }; }) All I want to unit test is that when this directive is compiled, and window.postMessage('message','*') is called, my message handler should be called: http://jsfiddle.net/mhu23/L27wqn14/ (including jasmine test) I'd appreciate

Share data from a directive within another isolated scope directive

早过忘川 提交于 2019-12-11 10:29:18
问题 I'm trying to take a component approach to my Angular code by writing component style directives, but I have run into a problem. Below is my html template for the page. Note that I'm using the AngularStrap tabs directive. The problem I'm having is that the woSamplesSummary.materialsCount is undefined right under the work-order directive (outside of the tab pane scope), but it displays correctly in the tab pane directive as part of the tab title (within the tab pane scope). So the basic issue

AngularJS ng-options inside custom directive which is inside ng-repeat

自作多情 提交于 2019-12-11 10:25:40
问题 Could you help me to find a way to set and get select element values which are placed inside my custom directive. This is what I have: <body ng-app="myApp"> <div ng-controller="MyCtrl"> <div ng-repeat="category in categories"> {{category.Name}}: <status-selector items="statuses" ng-model="selectedStates[status.Id]"></status-selector> </div> </div> </body> I have two arrays: categories and statuses. Each category can have its own status. When a status for a category is chosen, it should be

require angularjs directive using couchpotato

本秂侑毒 提交于 2019-12-11 10:24:54
问题 I'm trying to split my directives from being all in one file to dynamically calling directives when I need them. To do this I'm using couchpotato which can be found here: LINK I took a look at the example from the sample project found here but my attempt does not seem to work. No errors are reported either. This is my PLUNKR trying to use two directives one which just alerts a message and the other which just adds css to the element. 来源: https://stackoverflow.com/questions/17514812/require

how to give column equal width from total width?

无人久伴 提交于 2019-12-11 10:21:59
问题 I am trying to make example of grid view .I am dynamically generate the table view or grid view .I need column take equal % of width .Example if I have two column they will take 50% with individual .If there is three column then they will take 33.33% individual Please check image of grid what I am trying to make ![enter image description here][1] Here is my code http://plnkr.co/edit/X0PQov1UA2yEbx8qaOFl?p=preview <div class="row"> <div ng-repeat="d in data | filter:{checked: true}"> <div

Browser does not detect changes in AngularJS

混江龙づ霸主 提交于 2019-12-11 10:15:34
问题 Im developing an AngularJS application using IDE WebStorm and Safari browser. Everything has worked perfectly so far, but I recently encapsulated some HTLM in a template that I use via a directive: .directive('referenceValue', [function ($scope) { return { restrict: 'E', templateUrl: "views/citizenprofile/reference/reference.html", controller: "referenceValueCtrl" } }]) I "call" the directive the normal way, nothing fancy <reference-value></reference-value> When I edit the reference.html the

AngularJS Dynamic Directives and Method Binding

[亡魂溺海] 提交于 2019-12-11 09:56:49
问题 I'm trying to create an AngularJS version of the Bootstrap Panel to learn about dynamic directives. So far I've created a directive where you can insert arbitrary other directives, in example: <panel panel-model="panel" toggle-collapse="toogleCollapse"> <panel-body> <some-other-directive display-text="panel.content" ></some-other-directive> </panel-body> </panel> The panel directive has an isolated scope, that's why I'm passing the toggleCollapse function to the directive. Inside the panel

gulp-usemin TypeError: Path must be a string. Received undefined

谁说胖子不能爱 提交于 2019-12-11 09:54:11
问题 I'm using gulp-usemin for minify the javascript files I use in my app, for some reason gulp is not seeing one of my files. I have this in my index.html: <body ng-app="App"> <!--[if lte IE 8]> <p class="browsehappy">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.</p> <![endif]--> <div> <ui-view></ui-view> </div> <div class="footer"> <div class="container"> <!-- TODO: add fotter here --> </div> <

Set angularjs input directive name as a variable

故事扮演 提交于 2019-12-11 09:48:41
问题 I'm trying to set an input like <form name="myForm"> <input name="{{ name }}"/> </form> It works in the dom. I see <input name="whatever_name_is_set_to"/> However in my ngForm I have $scope.myForm: { {{ name }}: { } } Doh' Why am I doing this? I'm trying to create a directive so that I can build my forms programmatically. Then I can do something like <div my-field name="credits" field="course.credits" field-options="courseOptions.credits" title="Credits" ></div> Plunker 回答1: Updated 2017-03