小编Bur*_*Ice的帖子

Angular 5 选择和取消选择复选框

好吧,我有一个服务条款模态,它是 ngBootstrap 模态,当我按下按钮关闭该按钮时,我希望关闭模态的操作定义复选框是否选中,这是 html:

  <ng-template #content let-c="close" let-d="dismiss">
  <div class="modal-header">
  <h4 class="modal-title">Terms of service.</h4>
  <button type="button" class="close" aria-label="Close" (click)="d('Cross 
  click')">
  <span aria-hidden="true">&times;</span>
  </button>
  </div>
  <button type="button" class="btn btn-success" (click)="c('Close click'); 
   setAccepted(true)" >I accept.</button>
  </ng-template>
Run Code Online (Sandbox Code Playgroud)

打开模式和复选框的链接

<div class="custom-control custom-checkbox">
            <input *ngIf="accepted" type="checkbox" class="custom-
control-input" id="save-info" required>
            <label class="custom-control-label" for="save-info">I have read 
</label><a href="javascript:void(0)" (click)="open(content)"> 
  the terms of service</a>.
</div>
Run Code Online (Sandbox Code Playgroud)

在它下面我 <p>{{accepted}}</p>只是为了测试

还有打字稿

accepted: boolean = false;

constructor(private modalService: NgbModal) {}

open(content) {
 this.modalService.open(content);
}

setAccepted(accepted:boolean){
  this.accepted = accepted;
}
Run Code Online (Sandbox Code Playgroud)

我尝试了 …

checkbox angular

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

将dist复制到web服务器时出现Angular 5错误404

我做了一个简单的Angular 5封面,说我还在构建这个网站. ng serve工作正常,局部的,但现在我想举办这次对我校的网站在这里和我没有发现这些404个资源,我所做的就是副本什么在运行后DIST /文件夹ng build --prod,以在Web服务器上的WWW /文件夹.

这个cli版本的角度为5:

 "@angular/cli": "~1.7.1",
"@angular/compiler-cli": "^5.2.0",
Run Code Online (Sandbox Code Playgroud)

我试图将另一个推送到github-pages,这有同样的问题githubpages repo是repo但它几乎是一个空的回购.

hosting github-pages angular

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

标签 统计

angular ×2

checkbox ×1

github-pages ×1

hosting ×1