Question Editor with Preview
by janeklb
HTML
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/1.9.1/jquery.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/angular.js/1.1.3/angular.js"></script>
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.1/css/bootstrap-combined.min.css">
<div ng-app="testApp">
<div ng-controller="testMaster">
<div ng-controller="testSetup">
Draggables:
<ul>
<li ng-repeat="draggable in draggables">
{{draggable}}
</li>
</ul>
<a ng-click="addDraggable()">+ Add</a>
</div>
<div ng-controller="testPreview" class="well">
<div>
<div>
</div>
</div>
</div>
</div>
JavaScript
var app = angular.module('testApp', []);
app.controller('testMaster', function($scope) {
$scope.draggables = ['ONE'];
$scope.addDraggable = function() {
var name = prompt('Enter draggable name');
if (name) {
$scope.draggables.push(name);
}
};
});
app.controller('testSetup', function($scope) {});
app.controller('testPreview', function($scope) {});