I have been nearly everywhere looking for this, but please do forgive me if I ended up missing something. Here is my html:
<!DOCTYPE html>
<html>
<head>
<title>PDFHandle</title>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.5/angular.js"></script>
<script type="text/javascript" src="{{ url_for('static', filename='custom.js') }}"></script>
</head>
<body>
{% raw %}
<div ng-app="uploadApp" ng-controller="UploadController as uc">
<div ng-repeat="choice in uc.choices">
<input value="{{choice.value}}" />
</div>
<button ng-click="uc.addChoice()">Add</button>
</div>
{% endraw %}
</body>
</html>
And here is my AngularJS script:
var Try = angular.module("uploadApp", [])
.controller("UploadController", function UploadController() {
this.choices = [{id: "choice1", value:"Hello"}];
this.addChoice = function() {
return this.choices.push({id:"choice"+(this.choices.length+1), value:"Hello Again"});
};
})
The problem I'm facing is this (showing in Chrome's developer tools):
Uncaught Error: [$injector:modulerr] Failed to instantiate module uploadApp due to:
Error: [$injector:nomod] Module 'uploadApp' is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument.
I can run this by normally linking it with an HTML file just fine, it's just when I try to use it with a flask rendered HTML that it doesn't work. I have also tried this with other Angular IDEs and it's working fine in them as well. Like I said, just doesn't work with flask. Any help would be greatly appreciated. Thanks!