Click here to Skip to main content
15,889,403 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
My patientdetails.component.html code as follows


<div class="input-group" *ngIf="Patient">




Patient.component.ts code as follows

import { Component, OnInit ,Input} from '@angular/core';
import {Patient} from '../patient.model'
import { UpperCasePipe,LowerCasePipe,TitleCasePipe } from '@angular/common';


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


export class PatientinfodetailsComponent implements OnInit {
@Input() Patient: Patient;

constructor() { }
ngOnInit() {

var app = app.module('SAMPLEAPP', []);

app.controller('heroes', function($scope, $window) {
$scope.foo = function() {
$window.open('//google.com');
};
});
}
}


In run mode browser has follows

Rajesh - 356254
Both eyes are good clickhere (Button)

When i click the clickhere button i want to open a new tab.

for that i written the above code

But when i click the clickhere button it is not opening into new tab

What I have tried:

 My patientdetails.component.html code as follows

 
<div class="input-group" *ngIf="Patient">
    <div>
   <div> <a href="#" class="headinofbody">{{Patient.first_name | titlecase }} - {{Patient.mrd_no}}</a><br/>
   </div>
   
   <div class="sjexpand text-justify">
        <p id="sjddd" class="st text">
          {{Patient.remarks}}
      <button type="button" class="btn btn-primary-outline pull-middle" (click)="btnClick();">Click here</button>
       </p>    
   </div>

 </div>



          Patient.component.ts code as follows

import { Component, OnInit ,Input} from '@angular/core';
import {Patient} from '../patient.model'
import { UpperCasePipe,LowerCasePipe,TitleCasePipe } from '@angular/common';


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


export class PatientinfodetailsComponent implements OnInit {
  @Input() Patient: Patient;

  constructor() { }
  ngOnInit() {
   
        var app = app.module('SAMPLEAPP', []);
    
        app.controller('heroes', function($scope, $window) {
          $scope.foo = function() {
            $window.open('//google.com');
          };
        });
      }
    }


 In run mode browser has follows 

     Rajesh -  356254
     Both eyes are good  clickhere (Button)

    When i click the clickhere button i want to open a new tab.

   for that i written the above code 

  But when i click the clickhere button it is not opening into new tab
Posted
Comments
Nakhia_ind 26-Dec-17 1:55am    
sir you define foo function but call btnClick()
Afzaal Ahmad Zeeshan 26-Dec-17 3:14am    
Virtual 5.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900