Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to define templateUrl App components file. #48

Open
sri1980 opened this issue Sep 1, 2018 · 2 comments
Open

Unable to define templateUrl App components file. #48

sri1980 opened this issue Sep 1, 2018 · 2 comments

Comments

@sri1980
Copy link

sri1980 commented Sep 1, 2018

I would like to move the html content into .html file and use the templateUrl instead of template. I am getting 404 error. Can you please help me, am i missing anything?

@component({
selector: 'app5',
template: `


<img [src]="angularImg" style="width: 100px;"/>

This was rendered by App5 which is written in Angular 6


    <div>
        <b> Count: {{ count }}</b><br/><br/>
        <button (click)="increment()">local increment</button>&nbsp;Send a <b>local</b> increment event. This will
        only increase the counter for the current app. <br/>
        
        <button (click)="decrement()">local decrement</button>&nbsp;Send a <b>local</b> decrement event. This will
        only decrement the counter for the current app. <br/>

        
        <button (click)="globalIncrement()">global increment</button>&nbsp;Send a <b>global</b> increment event.
        This will increase the counter for the current app and all other apps that listen to this event. <br/>
        
        <button (click)="globalDecrement()">global decrement</button>&nbsp;Send a <b>global</b> decrement event.
        This will increase the counter for the current app and all other apps that listen to this event. <br/>
    </div>
	
    <br />
	<a [routerLink]="['/subroute1']" routerLinkActive="active">Angular route 1</a>&nbsp;
	<a [routerLink]="['/subroute2']" routerLinkActive="active">Angular route 2</a>

	<router-outlet></router-outlet>
`,

})

@sri1980
Copy link
Author

sri1980 commented Sep 1, 2018

Thanks for your help. it is very good article.

@fireappsAdmin
Copy link

What error are you getting?
You need to use templateUrl instead of template.
Where are you putting the selector in the html?
What does you NgModule look like?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants