angular-template


gulp templatecache and using html URL for Dialog box

北城余情 提交于 2020-01-25 14:26:05
问题 Hi I am using the gulp plugin, to create template of all my partials and later merge it with application js script and minified. var partials: ['app/**/*.html', '!app/index.html', '!app/bower_components/**/*.html'], gulp.src(partials) .pipe(plugins.angularTemplatecache("templates.js", {module: "mainApp", root: "app/"})); All .html load properly but when I try to specify html as part of some dialog box plugin inside some controller (I am using ng-material) it throws 404. ex - $mdDialog.show({

gulp templatecache and using html URL for Dialog box

我们两清 提交于 2020-01-25 14:23:05
问题 Hi I am using the gulp plugin, to create template of all my partials and later merge it with application js script and minified. var partials: ['app/**/*.html', '!app/index.html', '!app/bower_components/**/*.html'], gulp.src(partials) .pipe(plugins.angularTemplatecache("templates.js", {module: "mainApp", root: "app/"})); All .html load properly but when I try to specify html as part of some dialog box plugin inside some controller (I am using ng-material) it throws 404. ex - $mdDialog.show({

NgModel on Input type file

回眸只為那壹抹淺笑 提交于 2020-01-23 09:12:27
问题 I'm trying to make a binding to an input field type file through ngModel on the typical Angular way like this: <input type="file" id="fileUpload" [(ngModel)]="file"> and files:any My problem is that after I have chosen a file, the value of my variable files is still undefined Here an example with stackblitz: https://stackblitz.com/edit/angular-6mbdww 回答1: You have to do it externally through (change) event <input (change)="onFileChange($event)" type="file" id="fileUpload"> And access in the

NgModel on Input type file

自闭症网瘾萝莉.ら 提交于 2020-01-23 09:09:31
问题 I'm trying to make a binding to an input field type file through ngModel on the typical Angular way like this: <input type="file" id="fileUpload" [(ngModel)]="file"> and files:any My problem is that after I have chosen a file, the value of my variable files is still undefined Here an example with stackblitz: https://stackblitz.com/edit/angular-6mbdww 回答1: You have to do it externally through (change) event <input (change)="onFileChange($event)" type="file" id="fileUpload"> And access in the

Angular Templates on Rails

两盒软妹~` 提交于 2020-01-17 05:12:30
问题 I'm using the angular-rails-templates gem. I have a folder in my /app/assets/javascripts called templates and I have included it in application.js : //= require_tree ./templates Inside of templates there is a test.html file with <h1>hello world</h1> . For some reason, test.html is not being found though, when I log out $templateCache.info() (using app.run ) in the console I have: Object {id: "templates", size: 0} 回答1: This turned out to be a sprockets incompatibility (see here) The short

Angular and IE8 — HTML5 elements not styled inside ng-view

纵然是瞬间 提交于 2020-01-15 15:30:30
问题 So I am trying to get angular working on IE8. I have followed all the steps on http://docs.angularjs.org/guide/ie and it seems to be working -- I see the content of ng-view rendered on IE8 when I switch between views. The problem is that I don't actually see any content in the inspector: .. it's just an empty ng-view tag. I can see all of the content on the page, but no styling is applied to anything inside ng-view . I am not sure whether this is an angular or HTML5 issue. I have added the

Angular rendered DOM html custom attributes

試著忘記壹切 提交于 2020-01-15 11:44:27
问题 I am new to frontend and i began using Angular. When I look to the final DOM i see code like this <style> .pane[_ngcontent-c0]~ .... } </style> <div _ngcontent-c0 class="pane" ... This is using CSS attribute selectors but my question is related with the custom attribute "_ngcontent-c0", in html5 there is a new feature with the name of "data custom attributes that are prefixed with (data-*) name. In this case the custom attribute is not using the data- syntax , this does not make the document

Angular 6 - Ng-Container - Ng-Template inside Mat-table is not working

此生再无相见时 提交于 2020-01-04 09:08:23
问题 I am loading data into the mat-table data source from an API. There is an addnewrow() method which would add a new row at the top. I am actually trying to make the first column of the table editable. (i.e) user can give input only if they create a new row. The rest of the data in the table should not be editable. So for that I use a local flag variable false by default. Based on the flag, I am creating ng-template with ng-container. . If it's a new row, the first column is the only editable

How to handle template errors (and other errors) in angular 2?

白昼怎懂夜的黑 提交于 2020-01-01 05:20:17
问题 When ever there is a template error in angular 2, the entire application fails to work. Shouldn't only the component that had the template that caused the error, fail to work and the rest of the application be working fine? How to handle errors so that the application won't stop being responsive when an error occurs? 回答1: You can use custom ErrorHandler: class MyErrorHandler implements ErrorHandler { handleError(error) { // do something with the exception } } @NgModule({ providers: [{provide:

Use async pipe in ngFor on Observable of Observables (Angular)

北慕城南 提交于 2019-12-30 08:40:52
问题 I have variable defined like this: myVar: Observable<Observable<MyObject>[]> . I am using Angular4 feature to enumerate with async pipe *ngFor="let obsMyObject of (myVar | async)" now I have Observable of MyObject, but I need just MyObject. I could write something like that: <div *ngFor="let obsMyObject of (myVar | async)"> <div *ngIf="let obsMyObject | async; let MyObject"></div> </div> but I can not do this in inner div, because I am setting flex order (which doesn't have any effect on

工具导航Map