angularjs-directive

$scope variable not changing in controller when changed using directive

☆樱花仙子☆ 提交于 2020-01-06 23:46:14
问题 I tried in all ways (keeping the scope to false, etc but not able to change my scope in controller),am I missing something. directive: angular.module("ui.materialize.inputfield", []) .directive('inputField', ["$timeout", function ($timeout) { return { transclude: true, scope: {}, link: function (scope, element) { $timeout(function () { Materialize.updateTextFields(); // The "> > [selector]", is to restrict to only those tags that are direct children of the directive element. Otherwise we

Keep track of object ids properly after creating elements with ng-repeat

我的梦境 提交于 2020-01-06 21:22:19
问题 I have created a list of items with an object inside my controller $scope.devices = [ {"id": 0, "name": "sw", "class": 'sw' }, {"id": 1, "name": "mlr", "class": 'mlr'}, {"id": 2, "name": "lvm", "class": 'lvm'}, {"id": 3, "name": "ltc", "class": 'ltc'}, {"id": 4, "name": "fr", "class": 'fr'}, {"id": 5, "name": "cap", "class": 'cap'} ]; and ng-repeat in my HTML <li ng-repeat="device in devices" ng-click="selected(device.id)"></li> I can keep track of an item that is clicked with $scope.selected

Is it possible to get the innerHTML of a directive containing an ng-repeat before angular removes it from the DOM during bootstrapping?

荒凉一梦 提交于 2020-01-06 20:21:54
问题 I'm working on a style guide and want to add syntax highlighting and code samples dynamically without having to copy/paste and escape the code for each item. The idea is that for each bb-prism directive, I include a bb-sample element that contains my code sample. The bb-prism directive clones the innerHTML of the code sample, creates pre and code elements, and then copies the clone into the code element. It's pretty slick except for when using ng-repeat . Angular seems to remove the ng-repeat

Animation in angular js slide animation of div?

老子叫甜甜 提交于 2020-01-06 19:53:30
问题 Can you please tell me how we slide div when user click tab .I make demo in jQuery Mobile (fiddle http://jsfiddle.net/ezanker/o9foej5L/1/ ) in which I have three tab and using the tab it show transition can you please tell me how we can do same in angular ? I am trying to achieve this but I am not able to do that how I ail achieve this in angular? Plunker http://plnkr.co/edit/ornYCV15uV8lPNL1ujPL?p=preview $(function(){ $("#owl-demo").owlCarousel({ navigation : false, // Show next and prev

AngularJS directive for dom-manipulating based on form validation

青春壹個敷衍的年華 提交于 2020-01-06 11:49:06
问题 I'm using the AngularJS validation feature, like this: <input type="text" class="form-control" ng-required="true" name="application_name" id="application_name" ng-model="jobApplication.description" required> If input field is empty AngluarJS assigns the ng-invalid css class to the input field. Unfortunately the theme I use needs the css-class on the parent / surrounding div: <div class="form-group form-md-line-input " ng-class="!new_application_form.application_name.$valid && new_application

Unknown provider: serviceProvider -> service -> myDirective

柔情痞子 提交于 2020-01-06 08:44:54
问题 A recent change to the software I am working on left me with the following error: "exception: Error: [$injector:unpr] Unknown provider: tableNavigationProvider <- tableNavigation <- ajSearchSelectDirective http://errors.angularjs.org/1.4.7/$injector/unpr?p0=tableNavigationProvider%20%3C-%20tableNavigation%20%3C-%20ajSearchSelectDirective" Now I have looked at multiple stack overflow boards but none of them is any help. How do I find the problem with this error? Sites that I already looked at:

scope of event arguments in angular directive

跟風遠走 提交于 2020-01-06 03:25:14
问题 I have the following angular app to create a menu of sections/products. at present when rendered and hitting the 'add' button that is rendered within each li I want to add a section/product as a sub of that section however multiple new children are created. ultimately I wish to display a form which when submitted will create the child but that is the next step. Right now I need to limit the scope to the current section and not have multiple bound clicks. If you need more information please

Creating a 'tab-away' attribute Directive with AngularJS

为君一笑 提交于 2020-01-06 03:14:11
问题 I'm asking this question off the back of: Dynamically adding an attribute Directive to a transclude Directive in AngularJS where it was pointed out that the way I was attempting to do something was likely the wrong way to do it. Given that I'm newish to AngularJS, I probably am. This is what I'm looking to achieve, and how I'm going about it. If anyone can suggest a more appropriate way - using AngularJS - I'd appreciate it. The Initial Control/Directive I'm creating a dropdown panel control

Directive does not run link function when attribute changes value

允我心安 提交于 2020-01-05 17:46:01
问题 I have created a directive for encapsulating qTip2 library into my angular application (as described in another SO question) . I have a dictionary with different configurations for qTip and depending on the value I pass on the attribute cv-tooltip the appropriate configuration is passed in the .qtip call in the link function. This works fine for directives that are set in html (eg. shows a qtip on the right and cv-tooltip="left" on the left). Problem arises when I change the value of the

Directive does not run link function when attribute changes value

生来就可爱ヽ(ⅴ<●) 提交于 2020-01-05 17:44:52
问题 I have created a directive for encapsulating qTip2 library into my angular application (as described in another SO question) . I have a dictionary with different configurations for qTip and depending on the value I pass on the attribute cv-tooltip the appropriate configuration is passed in the .qtip call in the link function. This works fine for directives that are set in html (eg. shows a qtip on the right and cv-tooltip="left" on the left). Problem arises when I change the value of the