Commit Graph

18 Commits

Author SHA1 Message Date
Sean Perkins
bbfb8f81a6 fix(angular): ionTabsWillChange is fired before tab activation (#27991)
Issue number: Resolves #27212

---------

<!-- Please do not submit updates to dependencies unless it fixes an
issue. -->

<!-- Please try to limit your pull request to one type (bugfix, feature,
etc). Submit multiple pull requests if needed. -->

## What is the current behavior?
<!-- Please describe the current behavior that you are modifying. -->

`ionTabsWillChange` emits _after_ the tab view is activated in the
stack.

## What is the new behavior?
<!-- Please describe the behavior or changes that are being added by
this PR. -->

- `ionTabsWillChange` emits _before_ the tab view is activated in the
stack.

## Does this introduce a breaking change?

- [ ] Yes
- [x] No

<!-- If this introduces a breaking change, please describe the impact
and migration path for existing applications below. -->


## Other information

<!-- Any other information that is important to this PR such as
screenshots of how the component looks before and after the change. -->

Dev-build: `7.2.4-dev.11692040948.1fd0ecd2`
2023-08-18 15:07:09 +00:00
Sean Perkins
90f41243d9 feat(angular): support binding routing data to component inputs (#27694)
Issue number: Resolves #27476

---------

<!-- Please do not submit updates to dependencies unless it fixes an
issue. -->

<!-- Please try to limit your pull request to one type (bugfix, feature,
etc). Submit multiple pull requests if needed. -->

## What is the current behavior?
<!-- Please describe the current behavior that you are modifying. -->

Ionic Angular application on Angular v16 cannot use the
[`bindToComponentInputs`](https://angular.io/api/router/ExtraOptions#bindToComponentInputs)
feature to assign route parameters, query parameters, route data and
route resolve data to component inputs.

## What is the new behavior?
<!-- Please describe the behavior or changes that are being added by
this PR. -->

- Ionic Angular developers can use the option on `RouterModule.forRoot`
to enable the Angular feature for binding the route snapshot data to the
component inputs.

**Modules**
```ts
@NgModule({
  imports: [
    RouterModule.forRoot([/* your routes */], { 
      bindToComponentInputs: true // <-- enable this feature
    })
  ]
})
export class AppModule { }
```

**Standalone**

```ts
import { withComponentInputBinding } from '@angular/router';

bootstrapApplication(App, {
  providers: [
    provideRouter(routes, 
      //... other features
      withComponentInputBinding() // <-- enable this feature
    )
  ],
});
```

With this feature enabled, developers can bind route parameters, query
parameters, route data and the returned value from a resolver to input
bindings on their component.

For example, with a route configuration of:
```ts
RouterModule.forChild([
  {
    path: ':id',
    data: {
      title: 'Hello world'
    },
    resolve: {
      name: () => 'Resolved name'
    },
    loadComponent: () => import('./example-component/example.component').then(c => c.ExampleComponent)
  }
])
```
and a component configuration of:

```ts
@Component({ }) 
export class ExampleComponent {
  @Input() id?: string;
  @Input() title?: string;
  @Input() name?: string;
  @Input() query?: string;
}
```

Navigating to the component with a url of: `/2?query=searchphrase`

The following would occur:
- `id` would return `2`
- `title` would return `Hello world`
- `name` would return `Resolved name`
- `query` would return `searchphrase`

## Does this introduce a breaking change?

- [ ] Yes
- [x] No

<!-- If this introduces a breaking change, please describe the impact
and migration path for existing applications below. -->


## Other information

<!-- Any other information that is important to this PR such as
screenshots of how the component looks before and after the change. -->

This PR will need to be targeted to a minor release once a design doc is
approved by the team.

Dev-build: `7.1.3-dev.11689276547.129acb40`
2023-07-18 16:26:37 -04:00
Nicolas Sandron
71310372c9 feat(searchbar): add name property (#27737)
resolves #27675
2023-07-17 11:43:00 -04:00
Liam DeBeasi
32bc33ed28 refactor(angular): move to packages directory (#27719)
Issue number: N/A

---------

<!-- Please do not submit updates to dependencies unless it fixes an
issue. -->

<!-- Please try to limit your pull request to one type (bugfix, feature,
etc). Submit multiple pull requests if needed. -->

## What is the current behavior?
<!-- Please describe the current behavior that you are modifying. -->

The `angular` directory sits at the root of the project instead of in
`packages` with all the other JS Framework integrations. This does not
cause any functional issues with Ionic, but it is confusing since
integrations are not in a consistent place.

## What is the new behavior?
<!-- Please describe the behavior or changes that are being added by
this PR. -->

- Moves the `angular` directory to `packages/angular`

Note: Most files should remain unchanged. The only files I changed are
the files that had direct paths to the old `angular` directory:

1. Removes the `angular` path in `lerna.json`. This is now covered by
`packages/*`
2. Updated the angular file path in `.gitignore`
3. Updates the path to the angular package in `stencil.config.ts` for
the Angular Output Targets
4. Updates some of Angular's sync scripts to correctly get the core
stylesheets as well as the core package.
5. Updates the test app sync script to correctly sync core and
angular-server

~I'm not entirely sure why GitHub thinks
https://github.com/ionic-team/ionic-framework/pull/27719/files#diff-f5bba7e7c7c75426e2b9c89868310cb03890493b4efe0252adf8d12cc8398962
is a new file since it exists in `main` here:
1f06be4a31/angular/test/base/scripts/build-ionic.sh~
Fixed in
6e7fc49827

## Does this introduce a breaking change?

- [ ] Yes
- [x] No

<!-- If this introduces a breaking change, please describe the impact
and migration path for existing applications below. -->


## Other information

<!-- Any other information that is important to this PR such as
screenshots of how the component looks before and after the change. -->

Dev build: `7.1.2-dev.11688052109.13454f5c`
2023-07-05 17:52:35 +00:00
Brandy Carney
d37623a2ca chore(packages): move the packages to root 2018-03-12 16:02:25 -04:00
Adam Bradley
a1f942d45e chore(cleanup): remove unused code 2018-03-06 19:56:53 -06:00
Adam Bradley
9c93df48d8 style(lint): fix lint errors 2018-03-01 16:21:06 -06:00
Dan Bucholtz
edeb1324c9 refactor(nav): implement nav integration with external router (angular to start) 2018-02-13 00:02:48 -06:00
Manu Mtz.-Almeida
9226684826 perf(virtual-scroll): reduce DOM writes 2018-02-09 17:22:37 +01:00
Dan Bucholtz
73ce15f7da refactor(router): separate nav and router-outlet into two seperate directives 2018-02-06 00:50:00 -06:00
Manu Mtz.-Almeida
0babb2ece2 fix(virtual-scroll): working in angular 2018-02-01 23:39:46 +01:00
Dan Bucholtz
caca8ef864 feature(menu): add menuToggle directive 2018-01-09 15:49:48 -06:00
Dan Bucholtz
cefbee9ea2 feature(angular): action-sheet, alert, loading, toast 2017-12-06 11:48:24 -06:00
Ken Sodemann
ba5382e0b7 refactor(value-accessors): remove the ion prefix 2017-12-05 18:19:55 -06:00
Ken Sodemann
5641424db3 feat(value-accessors): move the value accessors into @ionic/angular 2017-12-05 15:03:18 -06:00
Dan Bucholtz
b634ffcff3 refactor(angular): update angular specific nav stuff to only use interfaces from @ionic/core 2017-11-22 15:44:05 -06:00
Dan Bucholtz
5ffb31f49a chore(angular): reverting changes to angular module, cannot figure out why app won't work if it's imported 2017-11-22 00:49:05 -06:00
Dan Bucholtz
f269766068 chore(angular/providers): making progress on angular providers, fix merge issues
* chore(input): remove interface .d.ts file, move to .ts file

* refactor(angular): start working on providers, etc

* chore(angular/dependencies): update deps for angular demo
2017-11-21 11:58:57 -06:00