Skip to content
This repository has been archived by the owner on Dec 16, 2022. It is now read-only.

feat(templates): Use searchClient in Angular #114

Merged
merged 3 commits into from
Jul 9, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions scripts/__snapshots__/e2e-templates.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,7 @@ describe('AppComponent', () => {

exports[`Templates Angular InstantSearch File content: src/app/app.component.ts 1`] = `
"import { Component } from '@angular/core';
import * as algoliasearch from \\"algoliasearch\\";

@Component({
selector: 'app-root',
Expand All @@ -386,9 +387,8 @@ exports[`Templates Angular InstantSearch File content: src/app/app.component.ts
})
export class AppComponent {
config = {
appId: 'appId',
apiKey: 'apiKey',
indexName: 'indexName',
searchClient: algoliasearch('appId', 'apiKey'),
};
}"
`;
Expand Down
3 changes: 2 additions & 1 deletion src/templates/Angular InstantSearch/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"@angular/platform-browser": "6.0.7",
"@angular/platform-browser-dynamic": "6.0.7",
"@angular/router": "6.0.7",
"algoliasearch": "3.29.0",
"angular-instantsearch": "{{libraryVersion}}",
"core-js": "2.5.7",
"rxjs": "6.2.1",
Expand All @@ -28,7 +29,7 @@
"devDependencies": {
"@angular/compiler-cli": "6.0.7",
"@angular-devkit/build-angular": "0.6.8",
"typescript": "2.9.2",
"typescript": "2.7.2",
"@angular/cli": "6.0.8",
"@angular/language-service": "6.0.7",
"@types/jasmine": "2.8.8",
Expand Down
4 changes: 2 additions & 2 deletions src/templates/Angular InstantSearch/src/app/app.component.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Component } from '@angular/core';
import * as algoliasearch from "algoliasearch";

@Component({
selector: 'app-root',
Expand All @@ -7,8 +8,7 @@ import { Component } from '@angular/core';
})
export class AppComponent {
config = {
appId: '{{appId}}',
apiKey: '{{apiKey}}',
indexName: '{{indexName}}',
searchClient: algoliasearch('{{appId}}', '{{apiKey}}'),
Copy link
Contributor

@samouss samouss Jul 9, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How do we handle versions that does not support searchClient (v1.x.x)?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We already don't because the components have been renamed in 2.x.x (we dropped ng-).

};
}