diff --git a/scripts/__snapshots__/e2e-templates.test.js.snap b/scripts/__snapshots__/e2e-templates.test.js.snap index aec9ce98c..8a2073cce 100644 --- a/scripts/__snapshots__/e2e-templates.test.js.snap +++ b/scripts/__snapshots__/e2e-templates.test.js.snap @@ -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', @@ -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'), }; }" `; diff --git a/src/templates/Angular InstantSearch/package.json b/src/templates/Angular InstantSearch/package.json index 3cfc7947f..d2f73cf79 100644 --- a/src/templates/Angular InstantSearch/package.json +++ b/src/templates/Angular InstantSearch/package.json @@ -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", @@ -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", diff --git a/src/templates/Angular InstantSearch/src/app/app.component.ts b/src/templates/Angular InstantSearch/src/app/app.component.ts index 32ee0bfa7..3e6c6bead 100644 --- a/src/templates/Angular InstantSearch/src/app/app.component.ts +++ b/src/templates/Angular InstantSearch/src/app/app.component.ts @@ -1,4 +1,5 @@ import { Component } from '@angular/core'; +import * as algoliasearch from "algoliasearch"; @Component({ selector: 'app-root', @@ -7,8 +8,7 @@ import { Component } from '@angular/core'; }) export class AppComponent { config = { - appId: '{{appId}}', - apiKey: '{{apiKey}}', indexName: '{{indexName}}', + searchClient: algoliasearch('{{appId}}', '{{apiKey}}'), }; }