I am having a little trouble with my angular custom directive. I want to access the "type"-variable in my filter, which is filterung objects (on the first level, so it should be possible without a custom filter).
This is the (very basic so far) structure:
angular.module('....').directive('ngTest', function () {
return {
restrict: 'AE',
replace: 'true',
scope: {
list: '=',
type: '@'
},
template: '<div><ul><li ng-repeat="information in list | filter:{ttype:type}">....</li></ul></div>'
}
});
Is there a way to access the variable in the template-string? Neither escaping nor using a template html file worked for me..
Thanks, Chris