Angular JS and Complex Directives
问题 This is an AngularJS widget which replaces a tag with an editable text field. Clicking the text replaces it with an input field, and hitting enter on the input updates an existing resource. I am not happy with the code I produced. Are all of these evals and applys really necessary? How can I improve this? To use editable-text(model="activeCustomer.phone_number", resource="Customer", field="phone_number") The Directive Code .directive("editableText", function($injector){ return { restrict: "E"