DEMO
Consider the following directive:
angular.module(\'MyApp\').directive(\'maybeLink\', function() {
return {
replace: true,
s
You can use ng-if for the same
Below is the working example
Working Demo
Directive Code:
angular.module('MyApp').directive('maybeLink', function() {
return {
replace: true,
scope: {
maybeLink: '=',
maybeLinkText: '='
},
template: '' +
' ' +
' ' +
'',
controller: function($scope) {
$scope.text = $scope.maybeLinkText.replace(/\n/g, '
');
}
};
});