Optionalmethod?: "push" | "replace"History navigation method
Controls whether navigation creates a new history entry or replaces the current one:
'push': Add a new entry to the history stack (default for path changes)'replace': Replace the current entry (default for query/hash/state changes)If not specified, the method is automatically determined based on whether the path changed.
import { PlatformServiceName } from '@limetech/lime-web-components';
const navigator = platform.get(PlatformServiceName.Navigator);
// Replace even though the path changes
navigator.navigate({
path: '/products/456',
method: 'replace',
});
// Push even though the path is unchanged
navigator.navigate({
query: { page: 2 },
method: 'push',
});
import {
LocationChange,
PlatformServiceName,
} from '@limetech/lime-web-components';
const navigator = platform.get(PlatformServiceName.Navigator);
// Update only the query parameters
const queryOnly: LocationChange = {
query: { page: 2 },
};
navigator.navigate(queryOnly);
// Navigate with a path and state
const withState: LocationChange = {
path: '/products/123',
state: { fromList: true },
method: 'push',
};
navigator.navigate(withState);
Partial location data for navigation
Used with Navigator.navigate to specify which parts of the location to change. All properties are optional, allowing selective updates.