-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Description
Ionic version: (check one with "x")
(For Ionic 1.x issues, please use https://github.com/ionic-team/ionic-v1)
[ ] 2.x
[ x ] 3.x
[ ] 4.x
I'm submitting a ... (check one with "x")
[ x ] bug report
[ ] feature request
Current behavior:
After upgrade to ionic-angular 3.9.2 , default value of segment
property doesn't use the value of name
, which does in the ionic-angular 3.5.3 version
Expected behavior:
If segment
property isn't provided, the segment
will use the value of name
.
Steps to reproduce:
- define two component with the same class name in two different folder, such as "PC/MainPage.ts" "Mobile/MainPage.ts"
@IonicPage({name:"PC_MainPage"})
@Component({
selector: "PC_MainPage",
templateUrl: "MainPage.html",
})
export class MainPage {
...
}
@IonicPage({name:"Mobile_MainPage"})
@Component({
selector: "Mobile_MainPage",
templateUrl: "MainPage.html",
})
export class MainPage {
...
}
it works well with ionic-angular 3.5.3. After I upgrade the project to ionic-angular 3.9.2 with angular 5.0.3, ionic serve shows the errors as below:
[14:09:54] watch started ...
[14:09:54] build dev started ...
[14:09:55] clean started ...
[14:09:55] clean finished in 4 ms
[14:09:55] copy started ...
[14:09:55] deeplinks started ...
Error: There are multiple entries in the deeplink config with the segment of MainPage
It seems that both of segment value of two components are 'MainPage' cause the problem.
After I modify the code with explicit segment value as below, no more errors
@IonicPage({name:"PC_MainPage", segment:"PC_MainPage"})
@Component({
selector: "PC_MainPage",
templateUrl: "MainPage.html",
})
export class MainPage {
...
}
@IonicPage({name:"Mobile_MainPage", segment:"Mobile_MainPage"})
@Component({
selector: "Mobile_MainPage",
templateUrl: "MainPage.html",
})
export class MainPage {
...
}