Angular Newbie here. I'm trying to understand the paradigm that should be used when developing an Angular application, so I can use external libraries while keeping the Angular application reusable.
So imagine I have a form that uses ng-submit:
<form ng-submit="submit()">...</form>
And then inside the respective ng-app and ng-controller (suppose they are declared in the parent), I have my submit function. But tell me, only on this page, I want to use a special warning library after sending:
$scope.submit = function(){
Now that the code is not being reused, is it? I can reuse this ng-app on another page to change and send data, but I do not want to use a special warning library. You seem to be trapped because the ng-submit attribute limits you to functions within the corresponding ng-app , not external functions. So, what is the correct way to invoke other Javascript code along with my Angular code without baking it into a model?
J-bob source share