jQWidgets Forums

jQuery UI Widgets Forums Plugins AngularJS How to use Angular directives inside isolated scope (jqx-Docking)

This topic contains 2 replies, has 2 voices, and was last updated by  Kavyad23 10 years, 7 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author

  • Kavyad23
    Participant

    Sample.html

    <body ng-controller="demoController">
    	<jqx-docking class="docking" id="jqxDockingwindow1">
    	<div>
    		<div>
    			<div sampleDirective></div>
    		</div>
    	</div>
    	</jqx-docking>
    </body>

    Directive.js

    demoApp.directive('sampleDirective', function() {
    	return {
    		templateUrl : 'directive.html',
    		link : function(scope, iElement, iAttrs) {
    			scope.value = false;
    			scope.open = function() {
    				if (this.value == false) {
    					$('#Window').jqxWindow('open');
    					this.value = true;
    				} else {
    					$('#Window').jqxWindow('close');
    					this.value = false;
    				}
    			};
    		}
    	};
    });

    directive.html

    <div class="picker">
        <input type="text" name="input"><img src="images/icon-calendar.png" ng-click="open()">
    </div>
    <jqx-window id="Window" jqx-width="345" jqx-height="200" jqx-auto-open="false" jqx-show-close-button="false">
    <div id="title">Title</div>
    <div>Content</div>
    </jqx-window>

    If I use, <div sampleDirective></div> outside isolated scope its working fine, When I click the image icon, the window is opening but If I put this directive inside docking its not working.


    Peter Stoev
    Keymaster

    Hi Kavyad23,

    I would suggest you to check my previous responses, because this situation repeats for 5th time. The answer is still the same – jqx-data attribute can be used for binding members of inner scope to members in outer scope.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com


    Kavyad23
    Participant

    Hi Peter,

    Yes, I know the use of Jqx-data, If $scope variables means we can use jqx-data, But its directive, I want to use this directive inside docking… How I can pass directive in jqx-data.? If I use this directive inside docking, The directive window is opening automatically but I set jqx-auto-open=”false” in directive.

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.