Skip to main content

All Questions

1vote
1answer
456views

Angular directive 1 way binding is working but 2 way binding is not

I am not using scope in my controller as i use controller as etc.. I have proof of concept that plunker without scope is working 1 way binding is working 2 way binding is NOT working - shows ...
user avatar
0votes
4answers
92views

If my Angular Controller is not using any $scope, then how do i do 2 way data binding in my directive

I have been using Angular without $scope Controller: angular .module('app') .controller('requestController', requestController); requestController.$inject = ['$location','requestService']; ...
user avatar
0votes
2answers
213views

How to compile Angularjs nested directive with javascript

I have a nested directive that has nested hierarchy. angular.module("app", []); angular.module("app").directive("hero", function () { return { restrict: "E", template: "<div>Hero {{...
barteloma's user avatar
0votes
1answer
568views

how to fill empty array with objects updated in directive?

I started my adventure with Angular directives. Somewhere in my app I have to choose number of passengers. Then I have to assign "First Name" and "Last Name" for each of them. So I created simple ...
Michal W's user avatar
0votes
1answer
507views

Retrieving model values from dynamically opened controller's scope in AngularJS

I am developing an Web Application using Angular JS. I am a beginner to AngularJS. In my app, I need to dynamically add and remove elements. I use directive for it. Adding and removing elements is ...
Wai Yan Hein's user avatar
2votes
1answer
2kviews

How to use custom directive on Input fields in Angular 1.x?

I'm trying to modify the input element using a custom AngularJS directive. Basically I want to replace any <input type="country"> fields with a country drop-down. But the directive doesn't seem ...
supersan's user avatar
0votes
2answers
55views

Call method in controller from directive

HTML : <div id="idOfDiv" ng-show="ngShowName"> Hello </div> I would like to call the function which is declared in my controller from my directive. How can I do this? I don't receive ...
Anonymous's user avatar
1vote
3answers
2kviews

ng repeat with custom directive

I am trying to read properties set on an element by ng-repeat using another custom element: <div foo ng-repeat="img in [{image: 'images/img1.jpg', text: 'some text'},{image: 'images/img2.jpg', ...
Yatin Gera's user avatar
1vote
3answers
93views

Modify ng-show within directive template from link

I have a directive element: return { restrict: 'E', replace: true, transclude: true, template: '<ul>' + '<li ng-show="hideItem">...
Oam Psy's user avatar
  • 8,663
0votes
1answer
392views

Add Directive Attribute to Directive Element

I have a directive element: return { restrict: 'E', replace: true, transclude: true, template: '<ul>' + '<li {{myNewAttrDirective}}&...
Oam Psy's user avatar
  • 8,663
3votes
1answer
706views

Directive inside templateUrl of another directive and passing attribute

I'm having two directives and I'm trying to call one directive inside another directive's templateUrl with some attribute but I'm not able to get the compiled attribute value in the second directive. ...
Teja's user avatar
  • 133
0votes
1answer
38views

Strange behaviour when adding directive dynamically in ngrepeat

I am trying to add a directive dynamically inside ngrepeat. Please refer to the following fiddle link: Fiddle Link Code: // Code goes here var app = angular.module('myApp',[]); // myDir Directive ...
Teja's user avatar
  • 133
0votes
2answers
70views

Can anyone explain the core concept of model in angularjs?

HTML Code: <mydirective></mydirective> <input type="button" ng-click="showText()" value="Show Service Text" /> Js Code: var app = angular.module('demo', []); app.service('...
Teja's user avatar
  • 133
1vote
2answers
1kviews

AngularJS getting data from controller to directive

I am trying do display data retrieved from database in controller to directive. I am using Controller as syntax, but when i try to display my data in directive it is undefined. I am getting right ...
Nedimo's user avatar
1vote
1answer
152views

Directive hierarchy & bindToController

I encountered an issue while writing an AngularJS directive. I'm actually trying to melt two principles, directive inheritance and using the controller object (the famous this) instead of $scope. I ...
Azca's user avatar

153050per page
close