You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+44-35Lines changed: 44 additions & 35 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,6 +19,7 @@ Choose the version corresponding to your Angular version:
19
19
20
20
Angular | @themost/angular |
21
21
--- | --- |
22
+
13 | 13.x+
22
23
12 | 12.x+
23
24
11 | 11.x+
24
25
6 | 6.x+
@@ -28,54 +29,62 @@ Angular | @themost/angular |
28
29
29
30
### Usage
30
31
31
-
Provide `DATA_CONTEXT_CONFIG` and set [`@themost-framework`](https://github.com/themost-framework) api server URI. Include `AngularDataContext` in application providers.
32
+
Import `MostModule` by using `MostModule.forRoot()` and configure `AngularDataContext`:
32
33
33
34
app.module.ts
34
35
35
36
import { NgModule } from '@angular/core';
36
-
import { HttpClientModule } from '@angular/common/http';
37
37
import { BrowserModule } from '@angular/platform-browser';
38
+
import { AuthModule, MostModule } from '@themost/angular';
38
39
import { AppComponent } from './app.component';
39
-
import {DATA_CONTEXT_CONFIG, AngularDataContext } from '@themost/angular';
40
+
40
41
@NgModule({
41
-
imports: [
42
-
BrowserModule,
43
-
HttpClientModule
44
-
],
45
-
providers: [
46
-
{
47
-
provide: DATA_CONTEXT_CONFIG, useValue: {
48
-
base: 'http://localhost:3000/'
49
-
}
50
-
},
51
-
AngularDataContext
52
-
],
53
-
declarations: [AppComponent],
54
-
bootstrap: [AppComponent],
42
+
declarations: [
43
+
AppComponent
44
+
],
45
+
imports: [
46
+
BrowserModule,
47
+
...
48
+
MostModule.forRoot({
49
+
base: '/api/'
50
+
}),
51
+
AuthModule.forRoot({
52
+
client_id: '9165351833584149',
53
+
scope: [
54
+
'profile'
55
+
],
56
+
locations: [],
57
+
login: '/auth/login',
58
+
callback: '/client/callback'
59
+
})
60
+
],
61
+
providers: [],
62
+
bootstrap: [AppComponent]
55
63
})
56
64
export class AppModule { }
57
65
58
-
app.component.ts
66
+
index.component.ts
67
+
68
+
import { Component, OnInit } from '@angular/core';
69
+
import { AngularDataContext } from '@themost/angular';
70
+
import { from } from 'rxjs';
59
71
60
-
import { Component } from '@angular/core';
61
-
import {AngularDataContext} from "@themost/angular";
0 commit comments