Last active
November 18, 2015 13:54
-
-
Save milannankov/54d78989fe0fd64c1223 to your computer and use it in GitHub Desktop.
reset-kendo-upload-angular
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var resetApp = angular.module('resetApp', [ "kendo.directives" ]); | |
resetApp.controller('resetUploadController', function ($scope, $compile) { | |
var uploadTemplate = '<input type="file" id="files" name="files" kendo-upload/>'; | |
$scope.resetUpload = function() { | |
// used to reset upload control | |
var uploadContainer = jQuery("#uploadContainer").empty(); | |
var uploadElement = angular.element(uploadTemplate); | |
var compiled = $compile(uploadElement); | |
uploadContainer.append(uploadElement); | |
compiled($scope); | |
}; | |
$scope.showForm = function() { | |
$scope.resetUpload(); | |
$scope.formWindow.center().open(); | |
}; | |
$scope.resetUpload(); | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html ng-app="resetApp"> | |
<head> | |
<meta charset="utf-8"> | |
<title>Reset Kenodo Upload</title> | |
<link rel="stylesheet" href="styles/Kendo/kendo.common.min.css"> | |
<link rel="stylesheet" href="styles/Kendo/kendo.uniform.min.css"> | |
<script src="scripts/jquery-1.11.3.min.js"></script> | |
<script src="scripts/angular.min.js"></script> | |
<script src="scripts/kendo.all.js"></script> | |
<script src="scripts/app.js"></script> | |
</head> | |
<body ng-controller="resetUploadController"> | |
<div><button ng-click="showForm()">Show form</button></div> | |
<div kendo-window="formWindow" k-visible="false"> | |
<form name="editForm" novalidate> | |
<fieldset> | |
<div> | |
<div> | |
<label for="name">Name</label> | |
</div> | |
<div> | |
<input type="text" name="name" class="k-input k-textbox" ng-model="currentResource.name" required> | |
</div> | |
</div><br /> | |
<div> | |
<div> | |
<label for="imageURL">Upload image</label> | |
</div> | |
<div id="uploadContainer"> | |
<!-- Kendo Upload container --> | |
</div> | |
</div> | |
</fieldset> | |
</form> | |
</div> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment