NgSwitch in directive with Jquery

by t4gedieb

HTML

<script src="http://code.angularjs.org/1.2.4/angular.js"></script>
<h1>My directive</h1>

<div ng-app="test">
    <label><span>1</span>

        <input type="radio" ng-model="option" value="1" />
    </label>
    <label><span>2</span>

        <input type="radio" ng-model="option" value="2" />
    </label>
    <label><span>other</span>

        <input type="radio" ng-model="option" value="other" />
    </label>
    <div style="background: orange">
        <table>
            <tr my-directive></tr>
        </table>
    </div>
</div>

JavaScript

angular.module('test', [])
    .directive('myDirective', function () {
    return {
        restrict: 'EA',
        replace: false,
        template: '<ng-switch on="option"><td ng-switch-when="1">NG-SWITCH-WHEN-1</td><td ng-switch-when="2">NG-SWITCH-WHEN-2</td><td ng-switch-default>NG-SWITCH-DEFAULT</td></ng-switch>'
    };
});