小编Jan*_*n69的帖子

Angular2 - 选择单选按钮时显示/隐藏部分

我必须根据选择的单选按钮显示或隐藏部分

 <input name="options"  [(ngModel)]="options" type="radio" [value]="true" [checked]="options==true"/> Yes

    <input name="options"[(ngModel)]="options" type="radio" [value]="false" [checked]="options==false"/> No</label>

<div>
      <h2 ng-show="options == 'true'">Supply</h2>
      <h2 ng-show="options == 'false'">Demand</h2>
</div>
Run Code Online (Sandbox Code Playgroud)

如果用户点击是,那么我们必须显示'供应'并隐藏'需求'如果用户点击否,那么我们必须显示'需求'并隐藏'供应.

但现在在加载表单时,屏幕上都会显示供应和需求.

radio-button primeng angular

10
推荐指数
2
解决办法
2万
查看次数

PrimeNG按钮不在angular2中显示fa图标和标签

我想在面板标题中显示"添加"和"删除"按钮.下面的代码显示没有fa-icon且没有标签的按钮

<p-panel>
  <p-header>
   <div>
     Registration Form
     <button type="button" pButton icon="fa-plus" style="float:right" label="Add">
     </button>
   </div>
  </p-header>
</p-panel>
Run Code Online (Sandbox Code Playgroud)

primeng angular

8
推荐指数
2
解决办法
1万
查看次数

如何使用jdbc模板将值列表作为参数传递给IN子句

我想将汽车名称作为绑定变量传递(在运行时更改)如何实现这一点.

Java版本1.7

private JdbcTemplate jdbcTemplate;

 public Collection<Cars> findAll(){

 String sql =  "SELECT NAME, YEAR, TYPE FROM CARS where NAME in ('Honda','Audi','Benz')";
        List<Cars> carsList = new ArrayList<Cars>();
        List<Map<String, Object>> rows = jdbcTemplate.queryForList(sql);
        for (Map row : rows) {
            Cars car = new Cars();
            car.setName(String.valueOf(row.get("NAME")));
            car.setType(String.valueOf(row.get("TYPE")));
            car.setYear(String.valueOf(row.get("YEAR")));

            carsList.add(car);
        }
        return carsList;
    }
Run Code Online (Sandbox Code Playgroud)

java jdbctemplate

7
推荐指数
1
解决办法
1万
查看次数

如何预选 Primeng Dropdown 值?

我在我的角度应用程序中有带有一组值的 primeng 下拉菜单。

在视图 Screen 中,下拉列表不显示所选值(保存在数据库中的值),而是显示“选择”。

HTML:

<p-dropdown    [options]="reasons" [(ngModel)]="selectedReason"   (onChange)="getCompleteReason($event)" styleClass="ui-column-filter" filter="true"> </p-dropdown>
Run Code Online (Sandbox Code Playgroud)

组件.ts

this.reasons = [];
    this.reasons.push({label: 'Select', value: null});
    this.reasons.push({label: 'Reason 1', value: 'Reason 1'});
    this.reasons.push({label: 'Reason 2', value: 'Reason 2'});
    this.reasons.push({label: 'Reason 3', value: 'Reason 3'});
    this.reasons.push({label: 'Other', value: 'Other'});


this.selectedReason = 'Reason 2' (eg value stored in the db)
Run Code Online (Sandbox Code Playgroud)

在此输入图像描述

angular primeng-dropdowns

5
推荐指数
1
解决办法
2万
查看次数

如何根据角度2应用程序中的md卡选择显示/隐藏primeng数据表列

我有2 md-card:controller和Scheduler.在单击控制器卡时,我必须显示controllerAssignedDate列并隐藏schedulerAssignedDate列,并且在单击Scheduler卡时,我必须显示schedulerAssignedDate列并隐藏controllerAssignedDate列.我怎么能在angular2应用程序中这样做

 <div><md-card-content><h3>Controller</h3></md-card-content></md-card></div>
 <div><md-card-content><h3>Scheduler</h3></md-card-content></md-card></div>

 <p-dataTable [value]="jobslist" [rows]="10" [paginator]="true" [rowsPerPageOptions]="[10,30,50]" sortMode="multiple" scrollable="true"   resizableColumns="true" scrollHeight="350px" >

      <p-header>List of Jobs </p-header>

      <p-column field="partNumber" header ="Part Number" [sortable]="true" [filter]="true" ></p-column>
      <p-column field="lineName" header ="Line Name" [sortable]="true" [filter]="true"></p-column>
      <p-column field="jobStatus" header ="Job Status" [sortable]="true" [filter]="true"></p-column>
      <p-column field="owner" header ="Owner" [sortable]="true" [filter]="true"></p-column>
      <p-column field="startDate" header ="Scheduled Start Date" [sortable]="true" [filter]="true"></p-column>
      <p-column field="controllerAssignedDate" header ="Date Assigned to Controller" [sortable]="true" [filter]="true"></p-column>
      <p-column field="schedulerAssignedDate" header ="Date Assigned to Scheduler" [sortable]="true" [filter]="true"></p-column>   
      <p-footer><div class="ui-helper-clearfix" style="width:100%"><a [routerLink]="['/register','']" ><button type="button" pButton icon="fa-plus" …
Run Code Online (Sandbox Code Playgroud)

primeng angular

3
推荐指数
1
解决办法
4195
查看次数

azure-pipelines.yml 中的错误意外值“步骤”

在构建和部署 docker image.Getting Unexpected value 'Steps' 在第 27 行之前,我试图将视频文件从 GPM 复制到 app/dist/asset/images 文件夹。

如果我删除了复制视频文件的步骤,YML 文件就可以正常工作。

azure-pipelines.yml

    trigger:
  branches:
    include: ['*']

pool:
  name: Default

# templates repo
resources:
  repositories:
    - repository: templates
      type: git
      name: comp.app.common.devops-templates
      ref: master

# Global Variables
variables:
  # necessary variables defined in this template
  - template: azure-templates/vars/abc-vars.yml@templates
  - name: dockerRepoName
    value: 'docker-it/library/xyz'
  # needed for k8 deployment
  - name: helmReleaseName
    value: xyz

stages:
  - steps:
    - bash: 'curl -o aa.mp4 https://gpm.mmm.com/endpoints/Application/content/xyz/bb.mp4'
      workingDirectory: '$(System.DefaultWorkingDirectory)/_hh_app/drop/app/dist/assets/images'
      displayName: 'Download Assets' …
Run Code Online (Sandbox Code Playgroud)

azure-pipelines azure-pipelines-yaml

3
推荐指数
1
解决办法
3484
查看次数

超链接到primeng数据表列

如何将超链接添加到primeng datatable列以将该列值传递到angular 2应用程序中的新窗口?

<p-column field="name" header ="Name" [sortable]="true" [filter]="true" >
    <ng-template let-row="rowData" pTemplate type="body">
      {{row.name}}
    </ng-template>
  </p-column>
Run Code Online (Sandbox Code Playgroud)

在数据表中单击名称时,必须在新页面的文本框中显示名称。谁能为此提供代码示例?

hyperlink angular primeng-datatable

1
推荐指数
1
解决办法
4024
查看次数

单击列中的图像后如何突出显示PrimeNG数据表行?

我有10列的PrimeNG数据表。最后一列包含图像。单击图像后,我必须突出显示该行。

如果我在数据表中添加选择模式“单一”,则在单击行时会突出显示该行。我不要那个。我希望仅在用户单击最后一列的图像时将其突出显示。

<p-column>
        <ng-template let-row="rowData" pTemplate type="body">
          <img src="assets/images/info_icon.jpg" style="height:20px;width:20px">
        </ng-template>
  <p-column>
Run Code Online (Sandbox Code Playgroud)

primeng angular primeng-datatable

1
推荐指数
1
解决办法
3992
查看次数

Primeng 自定义样式步骤显示为按钮而不是一行

我正在尝试在我的应用程序中实现primeng Steps。我按照文档中的示例创建自定义样式步骤。相反,我正在获得标准的样式步骤。.css 文件中的书面样式类。

step1.component.html
------------------------
<div>
<p-steps [model]="items" styleClass="steps-custom" [(activeIndex)]="activeIndex" ></p-steps>
</div>

step1.component.ts
--------------------

@Component({
    selector: 'app-routing',
    templateUrl: './step1.component.html',
    styleUrls: ['./step1.component.css'],
    providers: [RoutingService]
})

export class Step1Component  implements OnInit {

  items: MenuItem[];
  activeIndex: number = 1;

  constructor(private routingService: RoutingService) {
  }

  ngOnInit() {
    this.items = [{
      label: 'Personal',
      command: (event: any) => {
        this.activeIndex = 0;
      }
    },
      {
        label: 'Seat',
        command: (event: any) => {
          this.activeIndex = 1;
        }
      },
      {
        label: 'Payment',
        command: (event: any) => {
          this.activeIndex …
Run Code Online (Sandbox Code Playgroud)

primeng

1
推荐指数
1
解决办法
3424
查看次数