![](/img/trans.png)
[英]how to get ng-model value in directive
我在 AngularJS 中編寫了一個指令,並使用了具有 min-max 和 ng-model 屬性的輸入類型編號。 我使用了隔離的 scope。 在指令中,我寫了一個模糊事件。 我得到 min-max 值但沒有得到ng-model值:<input my-directive min="5" m ...
[英]how to get ng-model value in directive
我在 AngularJS 中編寫了一個指令,並使用了具有 min-max 和 ng-model 屬性的輸入類型編號。 我使用了隔離的 scope。 在指令中,我寫了一個模糊事件。 我得到 min-max 值但沒有得到ng-model值:<input my-directive min="5" m ...
[英]isolated scope data not displaying in directive template
我正在構建一個自定義的 Angular 指令來在我的應用程序中顯示分頁。 我正在使用隔離范圍來傳遞totalNoOfRecords但它沒有顯示出來。 任何幫助將不勝感激 這是我迄今為止嘗試過的代碼 我在其中調用指令的模板: <pagination totalData="111">< ...
[英]Calling function of controller from directive when using isolated scope?
我想從Directive調用Controller的函數,這是為了驗證。 但是,當我使用隔離范圍時,我對如何從Directive調用感到有些困惑。 這是指令的代碼:- Function在我的controller ,我認為我不需要編寫controller code 。 在我的html中 ...
[英]Is there any way to use controller scope variable in isolated scope without defining in html/jsp
下面的代碼說明了隔離范圍方案。 我們可以在HTML中添加以下代碼,以在指令的隔離范圍中訪問customer.name 現在的問題是,是否需要在隔離范圍內訪問多個控制器對象。 我們是否需要用HTML提及所有這些內容,或者有一種方法可以直接在JS中訪問它們? ...
[英]AngularJS - Pass value from isolated scope directive to another element
有沒有辦法在登錄操作期間加載數據時,將布爾值(dataLoading)從隔離的作用域指令傳遞到另一個元素,以顯示進度條? 的index.html login.component.js login.controller.js ...
[英]In AngularJS, if the child directive cannot access it's immediate parent's scope then would it inherit its nearest, non-isolated ancestor's scope?
我有兩個例子支持上述說法—— 1) 當使用 $scope ( http://plnkr.co/edit/kFM77mVReS7AUwZsNzCV?p=preview ) - 2) 當使用 controllerAs( http://plnkr.co/edit/zmIRa1t87ZIMDS6X ...
[英]How to bind ng-click to a custom directive and call a parent function?
我們正在使用Angular 1.4.2,我試圖使用ng-click從指令中獲取計數值,將其傳遞給函數,然后將其傳遞給父控制器。 經過一番努力后,它仍然可以正常工作,但是不幸的是,當我嘗試將此功能移回主代碼時,我無法使控制器綁定到隔離范圍。 應該很簡單,但是我嘗試將當前控制器注入指令中並嘗 ...
[英]What is the difference between '@' and '=' in directive scope in AngularJS?
我仔細閱讀了有關該主題的AngularJS文檔,然后擺弄了一條指令。 這是小提琴。 這里有一些相關的片段: 從HTML : 從窗格指令: 有幾件事我沒有得到: 為什么我必須使用帶有'@' "{{title}}"和帶有'=' "title" ? 我也可以直接訪問父作用域,而不 ...