Im wondering if there is a way to pass an argument to a directive?
What I want to do is append a directive from the controller like this:
$scope.titl
myApp.controller('mainController', ['$scope', '$log', function($scope, $log) {
$scope.person = {
name:"sangeetha PH",
address:"first Block"
}
}]);
myApp.directive('searchResult',function(){
return{
restrict:'AECM',
templateUrl:'directives/search.html',
replace: true,
scope:{
personName:"@",
personAddress:"@"
}
}
});
USAGE
File :directives/search.html
content:
{{personName}}
{{personAddress}}
the File where we use directive