mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-30 15:45:03 -05:00
12 lines
287 B
CoffeeScript
12 lines
287 B
CoffeeScript
define [
|
|
"base"
|
|
"ide/directives/SafePath"
|
|
], (App, SafePath) ->
|
|
|
|
App.directive "validFile", () ->
|
|
return {
|
|
require: 'ngModel'
|
|
link: (scope, element, attrs, ngModelCtrl) ->
|
|
ngModelCtrl.$validators.validFile = (filename) ->
|
|
return SafePath.isCleanFilename filename
|
|
}
|