here i am trying to create my own directive. I wanted to create data table. i don't know is i am doing anything wrong.please help me to find js-fiddle code ;
<div ng-app='test'>
<div ng-controller='ctrl'>
{{name}}
<div ibatable tb-head='header' model='model' columns='columns' ></div>
</div>
</div>
(function(){
var app=angular.module('test',[]);
app.controller('ctrl',function($scope){
$scope.name='ajith';
$scope.header=['Name','Class'];
$scope.columns=['m.name','m.class'];
$scope.model=[{name:'ajith',class:'12'},{name:'ajith1',class:'122'}];
});
app.directive('ibatable',function(){
return{
restrict:'A',
scope:{tbHead:'=',model:'=',columns:'='},
template:"<table><tr ><th ng-repeat='h in tbHead'>{{h}}</th></tr><tr ng- repeat='m in model'><td ng-repeat='c in columns'>{{m.+{{c}}}}</td></tr></table>"
//here i wnt to call m.name and m.class dynamically
};
});
})();