Created first CRUD view
Change-Id: I3e7f3f36896921cce671c6a53e0155de9165eeb3
diff --git a/src/app/views/crud/crud.html b/src/app/views/crud/crud.html
new file mode 100644
index 0000000..fbbec88
--- /dev/null
+++ b/src/app/views/crud/crud.html
@@ -0,0 +1,2 @@
+<h1>{{vm.title}}</h1>
+<xos-table config="vm.tableCfg" data="vm.tableData"></xos-table>
\ No newline at end of file
diff --git a/src/app/views/crud/crud.ts b/src/app/views/crud/crud.ts
new file mode 100644
index 0000000..b35c104
--- /dev/null
+++ b/src/app/views/crud/crud.ts
@@ -0,0 +1,42 @@
+import {IXosResourceService} from '../../rest/slices.rest';
+import {IXosTableCfg} from '../../core/table/table';
+export interface IXosCrudData {
+  title: string;
+  resource: string;
+  xosTableCfg: IXosTableCfg;
+}
+
+class CrudController {
+  static $inject = ['$state', '$injector'];
+
+  public data: IXosCrudData;
+  public tableCfg: IXosTableCfg;
+  public title: string;
+  public resourceName: string;
+  public resource: ng.resource.IResourceClass<ng.resource.IResource<any>>;
+  public tableData: any[];
+
+  constructor(
+    private $state: angular.ui.IStateService,
+    private $injector: angular.Injectable<any>
+  ) {
+    this.data = this.$state.current.data;
+    console.log('xosCrud', this.data);
+    this.tableCfg = this.data.xosTableCfg;
+    this.title = this.data.title;
+    this.resourceName = this.data.resource;
+    this.resource = this.$injector.get(this.resourceName).getResource();
+
+    this.resource
+      .query().$promise
+      .then(res => {
+        this.tableData = res;
+      });
+  }
+}
+
+export const xosCrud: angular.IComponentOptions = {
+  template: require('./crud.html'),
+  controllerAs: 'vm',
+  controller: CrudController
+};
diff --git a/src/app/views/index.ts b/src/app/views/index.ts
new file mode 100644
index 0000000..495e2a4
--- /dev/null
+++ b/src/app/views/index.ts
@@ -0,0 +1,8 @@
+import {xosCore} from '../core/index';
+import {xosCrud} from './crud/crud';
+
+export const xosViews = 'xosViews';
+
+angular
+  .module('xosViews', [xosCore])
+  .component('xosCrud', xosCrud);