Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我需要从 Controller 内部运行“遗留代码”并且需要获取元素
function EmailformController($scope) { // here I need to get current dom/jqueried element, how to do it? }
您将需要使用指令。你永远不应该在控制器内部处理 DOM 元素。只有您的业务逻辑应该进入控制器,DOM 操作应该进入指令。