angularjs-directive

angular directive transclusion and inheritance

ぃ、小莉子 提交于 2019-12-11 05:05:14
问题 I've got three directives: aiOutter, aiMiddle, and aiInner. app.directive('aiOutter', function() { return { restrict: 'A', scope: { data: '=' }, template: '<div>Outter: {{data}}</div>', transclude: true, link: function(scope, elem, attrs) { console.log('outter recognized'); return console.log('outter data:', scope.data); } }; }).directive('aiMiddle', function() { return { restrict: 'A', scope: { data: '=' }, template: '<div>Middle: {{data}}</div>', transclude: true, link: function(scope, elem

angularjs scroll to counter in ng-repeat

谁都会走 提交于 2019-12-11 05:03:26
问题 Need to scroll to specific element in a list if $index == $scope.counter of ng-repeat. HTML: <button type="button" ng-click="findA()">FIND TYPE A</button> <button type="button" ng-click="findB()">FIND TYPE B</button> <ul class="feeds"> <li ng-repeat="m in mList" ng-class="showActive($index)">{{m.s}}</li> </ul> JS: CONTROLLER: $scope.shouldScroll = true; $scope.mList=[{"s":3},{"s":23},{"s":33},{"s":12},{"s":31},{"s":231}]; $scope.showActive =function(index){ /* only if scope.counter == index ,

How to pass data to an angular-foundation modal $scope?

纵饮孤独 提交于 2019-12-11 04:58:10
问题 I am using angular-foundation and specifically the modal http://madmimi.github.io/angular-foundation/#/modal , i am confused in how to pass data to a modal while using one controller , i want to take an array value and update the modal to show a particular user info ,Ex: $scope.updateUserInfo = $scope.user[index] , the only issue is how to pass the data to the modal . myApp.controller('users',function ($scope,$location,$http,$modal,msg) { $http.get('api/v1/users') .success(function (data

How to communicate between directive (tree component) and any other controller or directive in AngularJS app?

巧了我就是萌 提交于 2019-12-11 04:50:03
问题 First of all, I have read so much info you all share about communication between controllers, that I'm now so confused about the BEST way to do it. I understand I should use service, but don't really know what it means from the examples you all wrote. Here is my scenario: Left side of my page I have a side bar with a simple folder/files tree. I have used angular Tree Component and it works great for me: http://jimliu.github.io/angular-ui-tree/ On the right side of the page, I have a view that

how to show different message on required and invalid?

余生颓废 提交于 2019-12-11 04:49:11
问题 can you please tell me how to show different message on required and invalid ?In other word .make a form from json using plugin .In that there are some required parameter .and some I need to validate example "Email".When user press "submit" button if user did not fill the field it show "this field is required" .and if user fill the value but not same patten than it say "invalid value".can we show different message as different situation . i used this plugin https://github.com/Textalk/angular

while Exporting to PDF, column content is exceeding the column border in uigrid angularjs

隐身守侯 提交于 2019-12-11 04:43:17
问题 if i get the column data like this with no space in between $scope.gridOptions.data = [{"name":"rasheedsyedabdulhameed"}]; and this is my gridoptions $scope.gridOptions = { columnDefs: [ { field: 'name' }, { field: 'name' }, { field: 'name' } ], enableGridMenu: true, enableSelectAll: true, exporterCsvFilename: 'myFile.csv', exporterPdfDefaultStyle: {fontSize: 9}, exporterPdfTableStyle: {margin: [30, 30, 30, 30]}, exporterPdfTableHeaderStyle: {fontSize: 10, bold: true, italics: true, color:

Directives messed up styling, AngularJS

╄→гoц情女王★ 提交于 2019-12-11 04:36:20
问题 My goal is to create a navigation-item directive, that will work with Twitter Bootstrap. My current code places the <li> tags further down a level, so I presume that's the reason bootstrap's CSS is not compatible. This is my directives.js file angular.module('wdiary.directives', []) .directive('navitem', [function(){ return { restrict: 'E', transclude: true, templateUrl: 'partials/directives/navitem.html', scope: {} , link: function(scope, element, attrs) { scope.redirectRoute = attrs

angular directive data binding happens after ng-change

可紊 提交于 2019-12-11 04:36:17
问题 Guys I'm experimenting something. template <input my-checkbox type="checkbox" ng-model="object.isChecked" ng-change="triggerChange()" ng-click="triggerClick()"> directive my-checkbox (written in coffeescript) angular.module('myApp') .directive('myCheckbox', ()-> return { restrict: 'A' replace: true, template: """ <div> <input type="checkbox" ng-model="ngModel" ng-change="ngChange()" ng-click="ngClick()"> </div> """ scope: { ngChange: "&" ngClick: "&" ngModel: "=" } } ) Observation When you

Handling Click-Aways for two or more of the same directive

我怕爱的太早我们不能终老 提交于 2019-12-11 04:29:44
问题 I'm attempting to create click-away functionality for an AngularJS directive (ie. when the user doesn't click a certain element, it hides). I'm adding an event to $(body) which detects a click. I then check whether either my directive or any of it's children have been clicked. If they haven't, it hides a div. This works fine when I have one directive, but the moment I add a second of the same kind, it's the second that handles the $(body).click() event. The first doesn't get a look-in. My

angular js '?' in ng-src causes infinite loop

∥☆過路亽.° 提交于 2019-12-11 04:03:07
问题 I am trying to get a way around IE getting images from cache while using AngularJS I have this following code <img ng-src="./individuals/image/{{team._id}}/{{member._id}}{{getRandom()}}" > In the controller $scope.getRandom=function(){ return "?ran="+new Date().getTime()+""; } When I run, I get this error Error: 10 $digest() iterations reached. Aborting! Watchers fired in the last 5 iterations: [["fn: function (a){\n\"use strict\";\ntry{for(var b=0,c=q,g;b<c;b++){if(typeof(g=l[b])==\"function