Skip to content

Commit c74a288

Browse files
committed
initial release
1 parent 5783822 commit c74a288

24 files changed

+13216
-38
lines changed

Diff for: README.md

+62-14
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,75 @@
1-
# AngularNeo4j
1+
### Use the power of Neo4j graph database in your Angular app
22

3-
This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 6.0.0-rc.6.
3+
#### Installation
44

5-
## Development server
5+
To install this library, run:
66

7-
Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files.
7+
```bash
8+
$ npm install angular-neo4j --save
9+
```
10+
```js
11+
import { AngularNeo4jModule } from 'angular-neo4j';
812

9-
## Code scaffolding
13+
@NgModule({
14+
imports: [
15+
AngularNeo4jModule
16+
]
17+
})
18+
export class AppModule { }
19+
```
1020

11-
Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`.
21+
### Usage
22+
The module includes a service and a design-free component utilizing this service: login form and query form. You are welcome to use this component as a foundation for your custom one.
1223

13-
## Build
24+
The fastest way to test everything:
1425

15-
Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `--prod` flag for a production build.
26+
```html
27+
<angular-neo4j></angular-neo4j>
28+
```
1629

17-
## Running unit tests
30+
Use the service in your own component:
1831

19-
Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io).
32+
```javascript
33+
import { AngularNeo4jService } from './angular-neo4j.service';
34+
...
35+
constructor(pprivate neo4j: AngularNeo4jService) {}
36+
```
37+
- `connect( url: string, username: string, password: string, encrypted?: boolean )` - Connect to your Neo4j instance
38+
```javascript
2039

21-
## Running end-to-end tests
40+
const url = 'bolt://localhost:7687';
41+
const username = 'neo4j';
42+
const password = 'neo4j';
43+
const encrypted = true;
2244

23-
Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/).
45+
this.neo4j
46+
.connect(
47+
url,
48+
username,
49+
password,
50+
encrypted
51+
)
52+
.then(driver => {
53+
if (driver) {
54+
console.log(`Successfully connected to ${url}`);
55+
}
56+
});
57+
```
58+
- `run( query: string, params?: object)` - Run the query with parameters. Returns array of records.
59+
```javascript
2460

25-
## Further help
61+
const query = 'MATCH (n:USER {name: {name}}) RETURN n';
62+
const params = { name: 'bob' };
2663

27-
To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md).
64+
this.neo4j.run(query, params).then(res => {
65+
console.log(res);
66+
});
67+
```
68+
- `disconnect()` - Close the active driver
69+
```javascript
70+
this.neo4j.disconnect()
71+
```
72+
73+
## License
74+
75+
MIT © [Maxim Salnikov](mailto:[email protected])

Diff for: gulpfile.lib.js

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
require('./src/lib/build-tools/gulpfile');

0 commit comments

Comments
 (0)