ui-codemirror
ui-codemirror copied to clipboard
codemirror doesn't work inside ng-show
It doesn't work when it's loaded inside ng-show. However, it does work with ng-if.
It also doesn't work inside an ng-repeat, and neither inside a directive.
I can't find a way to have multiple instances like this:
<div ng-repeat="tab in tabs">
<textarea ui-codemirror="tab.options" ng-model="tab.content"></textarea>
</div>
I also tried wrapping it inside a directive like this:
<div ng-repeat="tab in tabs">
<div code-editor="tab"></div>
</div>
app.directive('codeEditor', function() {
return {
restrict: "A",
template: '<textarea ui-codemirror="tab.options" ng-model="tab.content"></textarea>',
scope: {
tab: '=codeEditor'
},
link: function($scope, $element, $attrs) {
$scope.$watch('tab.content', function(content) {
$scope.tab.dirty = (content != $scope.tab.original);
});
}
};
});
any ideas why is not working? In the meanitme I probably going to try to build my own codemirror directive.
I'm running into the same issue when the directive is within ng-if
Possible duplicate of #24