How to use ng-container with ng-content (with select tag) in angular 4

Issue How do you use ng-container in combination with ng-content that has a select tag. <div class=”container”> <div id=”first”> <ng-container *ngTemplateOutlet=”widgetContent”></ng-container> <div> <div id=”second”> <ng-container *ngTemplateOutlet=”widgetContent”></ng-container> </div> </div> <ng-content #widgetContent select=”side-widget, [sidewidget]”></ng-content> Solution Try this <div class=”container”> <div id=”first”> <ng-container

Continue reading

Angular 6: get reference to Components created with *ngFor inside ng-container tag

Issue I’using ng-container to iterate on a list and create components <ng-container *ngFor=”let f of optionsList; let i = index;”> <!– component–> <app-component #fieldcmp *ngIf=”isAppComponent(f)” ></app-field> <!–another components–> <app-anoter-component1 *ngIf=”isAnotherComponent1(f)”> </app-anoter-component1> … <app-anoter-componentn *ngIf=”isAnotherComponentn(f)”> </app-anoter-componentn> </ng-container> I would to list

Continue reading

Angular 6 Form Array cannot be accessed inside an ng-container

Issue I have an ng-container that describes all of my possible form field templates, essentially on a large switch statement depending on the field’s metadata: <ng-template #dynamicFormField let-field=”inputField”> <div *ngIf=”field.dataTypeName == ‘ShortText'”> <mat-form-field class=”col-md-6″> <input matInput type=”text” [placeholder]=”field.attributeLabel” [formControlName]=”field.attributeName”> </mat-form-field>

Continue reading

Injecting component to ng-container? (load ng-template from file)

Issue I’m trying to build a simple tabs-menu in my Angular app. parant.component.html: <div> <button (click)=”selectTab(1)”>Tab1</button> <button (click)=”selectTab(2)”>Tab2</button> <ng-container *ngTemplateOutlet=”(selected == 1) ? template1 : template2″> </ng-container> <ng-template #template1>I’m page 1</ng-template> <ng-template #template2>I’m page 2</ng-template> </div> parant.component.ts: public selected =

Continue reading

no render with mat-error, ng-template and *ngTemplateOutlet

Issue This code is working fine and properly (without ngTemplateOutlet): <mat-form-field [formGroup]=”formGroup”> <input matInput type=”text” [formControlName]=”fControlName” > <ng-container *ngIf=”isShowErrors()” ngProjectAs=”mat-error”> <ng-container *ngFor=”let error of showSMErrors” > <mat-error>{{ error.message }}</mat-error> </ng-container> </ng-container> </mat-form-field> But this code isnt working properly(with ngTemplateOutlet), why?

Continue reading

angular 8: single ng-container for multiple view child references

Issue I have three viewchild decorators in my component like this: @ViewChild(‘propertiesPage1’, { read: ViewContainerRef, static: true }) propertiesPage11: ViewContainerRef; @ViewChild(‘propertiesPage2’, { read: ViewContainerRef, static: true }) propertiesPage22: ViewContainerRef; @ViewChild(‘propertiesPage3’, { read: ViewContainerRef, static: true }) propertiesPage33: ViewContainerRef; The references

Continue reading

Child doesn't render template passed by parent

Issue Well, this is my parent component where I am trying to pass the template nodeTemplate to the child ils-tree <div class="nodes-panel"> <ils-tree layout="horizontal" [json]="nodes" [template]="nodeTemplate"> </ils-tree> </div> <ng-template #nodeTemplate> <ng-template let-node pTemplate="default"> <p class="node-type">{{node.data.nodeType}}</p> <p class="node-name">{{node.data.name}}</p> </ng-template> <ng-template let-node

Continue reading

How to load the ng-template in separate file?

Issue In below sample, I have used ng-template like below and it is working fine. Sample link: click here <ng-template #template let-dataSource=””> <span *ngIf=”dataSource.iconCss” class=”e-menu-icon {{dataSource.iconCss}}”></span> {{dataSource.header}} {{dataSource.text}} <span *ngIf=”dataSource.templateHeader” class=”e-login-content”> <button ejs-button cssClass=”e-info”>Sign In</button> </span> </ng-template> But I want

Continue reading

Vim syntax (Markdown)

Issue I’m currently exploring the prurigro/vim-markdown-concealed plugin with the conceal option. The highlight I get for the *italic* and **bold** words is not very pretty. The problem can either come from my colorscheme or the plugin syntax. So I looked

Continue reading

WinEdt highliting switch: how to skip nested STOP symbol?

Issue I have created a highlighting switch in WinEdt8 as following: SWITCH=”\REVR{?}” ENABLED=1 MODE_FILTER=”TeX;BibTeX;MetaPost” START=”{” STOP=”}” HIGHLIGHT_START=0 STEP_OVER_STOP=1 HIGHLIGHT_STOP=0 SCOPE=4 DOMINANT_PRIORITY=0 STRICT_PRIORITY=0 PRIORITY=9 INDENTED=0 BOLN_ONLY=0 CASE_SENSITIVE=1 START1_TRIGGER=”\REVR” START2_TRIGGER=”” STOP1_TRIGGER=”” STOP2_TRIGGER=”” DEFAULT_FONT=1 ITALIC=0 TEXT_COLOR=”#FF0000″ Since the STOP symbol is “}”, the

Continue reading

File diff souce code highlighting

Issue various JavaScript libraries provide syntax highlighting functionality to display code on a webpage. Some example for those libraries are: Ace (http://ace.c9.io/) – yes, I am aware that this is a whole editor Prism JS (http://prismjs.com/) SyntaxHighlighter (http://alexgorbatchev.com/SyntaxHighlighter/) …and many

Continue reading

MAXScript complete function list?

Issue Writing highlighter for MAXScript. I need list of keywords and functions. There’s a reference for MAXScript: http://docs.autodesk.com/3DSMAX/16/ENU/MAXScript-Help/index.html?url=files/GUID-6FC81BE7-58FF-4C63-8362-0BDCFA9F904C.htm,topicNumber=d30e122065 But it’s hard to rip function list from there. Maybe it could be found somewhere else? I mean, at least listed in

Continue reading

Highlight for java?

Issue I’m basically writing a website with play framework and I want to turn code snippets to nicely formatted, highlighted html code. Is there any java library on maven that deals with raw code formatting to html like linux command

Continue reading

google-code-prettify removes text in angle bracket

Issue I am using google-code-prettify to syntax-highlight CPP code. I used it as follows. <script src=”https://google-code-prettify.googlecode.com/svn/loader/run_prettify.js?lang=cpp”></script> <pre class=”prettyprint”><code> #include <iostream> using namespace std; int main(){ cout << “Hellow world!” << endl; return 0; } </code> </pre> In the result I

Continue reading

How to use CDN hosted highlight.js using Rails?

Issue Where do I place the following links to get highlight.js to work on my Rails application (https://highlightjs.org/download/)? <link rel=”stylesheet” href=”//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.4/styles/default.min.css”> <script src=”//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.4/highlight.min.js”></script> Solution on app/views/layouts/application.html In the middle of head tags. Sometimes is hard to identify something in the

Continue reading