AngularJS Live Example
HTML
<script src="http://code.angularjs.org/1.2.1/angular-route.min.js"></script>
<div ng-app="embraceTasks">
<div ng-view>
Loading angular..
</div>
<script type="text/ng-template" id="tasksNewTask">
<form id="newTaskForm" name="newTaskForm" ng-model="newTaskForm" ng-submit="submitNewTask()">
{{value}}
<button id="newtaskSubmit" type="submit" class="emui-button task-submit-button">Taak aanmaken</button>
</form>
</script>
</div>
JavaScript
var tasks = angular.module('embraceTasks', ['ngRoute']);
tasks.config(['$routeProvider', function ($routeProvider) {
$routeProvider.otherwise({
templateUrl: 'tasksNewTask',
controller: 'NewTasksController'
});
}]);
tasks.controller('NewTasksController', ['$scope',
function ($scope, $location, tasksData, embraceData, sharedProperties) {
$scope.submitNewTask = function(){
$scope.value = "yo werkt";
};
}]);