Reputation: 371
I've implemented Angular 2 app with the routing, its working fine with the URL like serverURL/Home/Index
its properly navigating to appropriate component without any errors.
But when I try entering serverURL/Home/Index/2
its giving me the following error
I've written below snippet in the web.config for Rewriting in IIS
<system.webServer>
<rewrite>
<rules>
<rule name="AngularJS" stopProcessing="true">
<match url=".*" />
<conditions logicalGrouping="MatchAll">
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
</conditions>
<action type="Rewrite" url="src/" />
</rule>
</rules>
</rewrite>
</system.webServer>
Even I've written { path: "Index/:id", component: IndexComponent },
in the routing file
Please help in this, thanks in advance.
Upvotes: 1
Views: 62