I'm working through a small script and for some reason I'm getting 
duplicate output and not sure where its coming from..

userloginComponent is the only component calling the html script you see 
Assuming it has something to do with the area I highlighted in red but cant 
seem to see the logic..

See screenshot of output.


export class UserLoginComponent implements OnInit {   
    private userFound: UserType[];
    private errMsg1; 
    testingE = '';
    private testUser = {userName : 'anna'};   

    constructor(private  _findUser: FindUserService, private _router: 
Router) {}

                userData => { 
                    if(userData.length === 0) {                        
                        this.errMsg1 = 'User not found!!';
                        return false;
                    } //end of if statement
                    else {
                        this.userFound = <any>userData[0]; 
                        return true;
                    }// end of else statement
                (error) => { this.testingE = `internal error ${error}`},   


the html which displays the results
        {{ this.userFound.userName }}              
        <pre> {{ this.userFound | json }} </pre>
    <div *ngIf="this.errMsg1">Unable to locate user!!!</div>

You received this message because you are subscribed to the Google Groups 
"Angular" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to angular+unsubscr...@googlegroups.com.
To post to this group, send email to angular@googlegroups.com.
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to