[英]how to build spesific modules in angular 2+
我想知道有什么方法可以從具有多個模塊的應用程序中構建特定模塊。 例如,我在一個應用程序中有模塊a,b和c,但是對於我的一位客戶,只需要b和c。 我不想編譯所有模塊並刪除不需要的塊,以尋找一種編譯僅作為命令或其他方式傳遞的塊的方法。 任何幫助,高度贊賞。 ...
[英]how to build spesific modules in angular 2+
我想知道有什么方法可以從具有多個模塊的應用程序中構建特定模塊。 例如,我在一個應用程序中有模塊a,b和c,但是對於我的一位客戶,只需要b和c。 我不想編譯所有模塊並刪除不需要的塊,以尋找一種編譯僅作為命令或其他方式傳遞的塊的方法。 任何幫助,高度贊賞。 ...
[英]Angular 4 - Compile [ngClass] inside jquery append
我是Angular 4的新手,嘗試使用$()。append()方法動態附加li內容。 我無法編譯和使用[ngClass]指令 。 jQuery正在將其視為字符串並附加到DOM。 我想編譯它作為angular 4指令動態執行。 包含偽數據的數組如下。 使用jQuery循環遍 ...
[英]Angular 2 dynamic html
我已經在angular 2視圖中創建了一個表,我想動態綁定html或angular組件。 我可以識別組件中的每個單元格 但是我不能像這樣綁定html或Component。 ...
[英]Add custom elements and attributes to compiler schema
組件模板中有一些自定義元素和屬性(在這個例子中它們被第三方非 Angular 代碼使用): 它們會導致編譯器錯誤: 如何將foo元素和data-bar屬性添加到編譯器架構中? NO_ERRORS_SCHEMA不是一個選項,因為不希望將其他未知元素和屬性列入白名單。 ...
[英]How to compile dynamic template in ng-content in angular 2
我試圖通過編寫自定義組件/指令來擴展/包裝第三方(Angular Material 2)指令。 對於一個按鈕, 我不是直接在我的應用程序的所有位置使用上面的控件,而是將它包裝在一個自定義組件中,我將在一個地方進行配置更改,它將影響使用自定義組件的所有其他位置。 這里在Aft ...
[英]Angular 2 AOT Webpack CSS relative nested url
我在項目中使用Material-Design-Icons ,並將其CSS導入自己的CSS文件中。 這是這樣做的: app.component.css materialdesignicons.css 現在,初始導入(來自app.component.css )和嵌套導入( ...
[英]How to use RouterModule.forRoot() in Angular2 compiler/cli ngc command
假設我有以下appRoutingModule: 使用ngc cli命令編譯時,會出現以下錯誤: 我嘗試將它放在導出的const中: 但是這會產生這個錯誤: 讓這個工作的解決方法/修復方法是什么? 如果我無法將其傳遞給RouterModule,如何定義我的路由? ...
[英]Angular 2: functions/methods on click inside dynamic template (dynamic component)
遵循以下示例: 如何使用/創建動態模板以使用Angular 2.0編譯動態組件? 我開發了自己的模板生成器,該模板生成器直接從變量獲取HTML內容。 在這里是: http : //plnkr.co/edit/2Sv1vp?p=preview 現在,我的問題是...如果模板內容 ...
[英]Dynamically load HTML template in angular2
我使用angular-cli創建了一個項目,其中包含AppComponent如下: 和app.component.html作為 因此,當我使用ng build構建它時,它會生成一些類似./dist/main.bundle.js的文件,其中包含一些代碼如下 - 這意味着,在構建時,comp ...
[英]Unknown compiler option 'angularCompilerOptions' in angular 2 ahead-of-time compilation
我正在嘗試在這個 angular 2項目中使用AOT編譯器。 我收到錯誤消息: TypeError: this.compiler.compileModules執行命令"node_modules/.bin/ngc" -p tsconfig-aot.json時, TypeError: this.c ...
[英]Typescript 2.1 coupled with the Angular 2 compiler silently fails to compile project files (no output)
使用以下typescript和angular編譯器配置: tsconfig.json / compiled目錄只包含/ node_modules / @ angular,而缺少所需的ngfactory文件的/ app目錄。 編譯以靜默方式結束,沒有錯誤也沒有輸出。 它適用於 ...
[英]Angular2 SystemJs, Ahead of Time Compilation with Gulp
任何人都可以指導如何使用Gulp提前編譯使用SystemJs的Angular2項目。 我的意思是使https://angular.io/docs/ts/latest/cookbook/aot-compiler.html中提到的所有步驟自動化 即生成NgFactories,搖樹和捆綁? ...
[英]Does the Angular 2 compiler (ngc) work with Typescript definition files?
構建針對Windows 10 UWP的Ionic 2應用程序。 在我的整個代碼中,我像這樣直接訪問winrt API var localStorage = Windows.Storage.ApplicationData.current.localStorage; 使用tsc進行編譯 ...
[英]recursive dynamic template compilation in angular2
我的一些工作基於此處描述的相同問題: 使用 Angular 2.0 編譯動態組件的動態模板 如何使用/創建動態模板來使用 Angular 2.0 編譯動態組件? 可以在此處找到上述問題中描述的工作 plunker。 如果動態詳細信息嘗試創建另一個在模板中使用動態詳細信息的動態視圖,則會出現問 ...
[英]compiler-cli throws error as dynamic declarations are encountered
因此,我來到了一個相當大的項目,該項目的開發理念是,隨着Angular升級到完全2.0版本,它將啟用AoT編譯功能,最后我從Angular獲取所有API並准備好進行此操作,或者看起來如此。 .. 首先,在Angular 2和Typescript 2.0.2的JiT模式下,項目運行非常好 ...
[英]“Can't read the url” error for angular2 dynamic components with templateUrl
試圖從這里修改靈魂。 它工作正常,但是如果將組件中的模板更改為templateUrl,則應該動態加載,則會出現錯誤:“未提供ResourceLoader實現。無法讀取url ...”。 在活生生的例子plunker 。 任何想法如何解決這一問題? ...
[英]Angular2 No provider for CompileMetadataResolver
所以我已經從RC1升級到了Angular2的最終版本。 我做了很多調整,但是每次將RuntimeCompiler注入AppComponent ,都會發生此錯誤。 我不知道這里發生了什么,也沒有看到有關此問題的網絡答案。 任何幫助將不勝感激,無論如何這里是我的AppComponen ...
[英]Angular 2 RC 6 AoT Compiler not working
我剛剛將我的項目更新為Angular 2 RC 6.我現在正在嘗試使用Ahead of Time(AoT)編譯,如博客文章http://angularjs.blogspot.com/中所述,但沒有成功。 我在ASP.Net中構建項目時沒有使用angular cli。 正如博客文章所暗 ...
[英]How can I use/create dynamic template to compile dynamic Component with Angular 2.0?
我想動態創建一個模板。 這應該用於在運行時構建一個ComponentType並將它放置(甚至替換)在宿主組件內部的某個地方。 在 RC4 之前,我使用的是ComponentResolver ,但在 RC5 中,我收到以下消息: ComponentResolver is deprecated for ...
[英]Angular2 Universal error Cannot find module '@angular/compiler/src/template_parser' after upgrading to RC5
我使用angular2,webpack和angular universal項目構建正常但我在運行時遇到以下錯誤。 使用角度RC4可以正常工作 Error: Cannot find module '@angular/compiler/src/template_parser' at Funct ...