daniel-nagy / md-data-table

Material Design Data Table for Angular Material
MIT License
1.9k stars 520 forks source link

html format #564

Open zuhrasofyan opened 7 years ago

zuhrasofyan commented 7 years ago

How to show correctly text with some simple html format (e. g: \n for line break)? I am using filter with trustAsHtml such as below, but it does not work, while if I am using non md-data-table, it works.

.filter('unsafe', function ($sce){
    return function (val) {
        return $sce.trustAsHtml(val);
    }
  })
waitingduck commented 7 years ago

I have similar requirement as you about put a html into a cell. What I did is expose $sce.trustAsHtml to scope and use it in view.

You can check this stackoverflow.