javascript - Angularjs how to pass in data using a directive -
what trying make function can change height of ng-grid column width. irrelevant besides fact scope controller needs communicate scope in directive.
.directive('getwidth', function(){ return{ controller: 'quotesctrl', link: function(scope){ scope.smrowheight = function(the value want){ scope.therowheight = value want; } } } }) and want able go html , hey div want height 20
<div getwidth = '20'></div> i have looking around , couldn't find doing exact thing. , way, in quotesctrl initialized row height so
$scope.therowheight; any suggestions?
try this:
.directive('getwidth', function(){ return{ controller: 'quotesctrl', link: function(scope){ console.log(scope.therowheight); }, scope: { 'therowheight': '=' } } }); markup:
<div the-row-height="20"></div>
Comments
Post a Comment