From 671bf584333cea7e997ca313f4d7d4cbe277a81c Mon Sep 17 00:00:00 2001 From: Iuri Matias Date: Wed, 14 Feb 2018 07:01:33 -0500 Subject: [PATCH] add use case of imports in different files on test_app --- test_app/app/js/app.js | 11 ++++++++++- test_app/app/js/index.js | 2 +- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/test_app/app/js/app.js b/test_app/app/js/app.js index 64398919..c17684e1 100644 --- a/test_app/app/js/app.js +++ b/test_app/app/js/app.js @@ -1,11 +1,20 @@ import { Component } from 'react'; +import SimpleStorage from 'Embark/contracts/SimpleStorage'; +window.SimpleStorage = SimpleStorage; class App extends Component { + action() { + console.log("calling...") + SimpleStorage.methods.get().call(function(err, value) { + alert(value); + }) + } + render() { return (
-

Welcome to React

+

this.action() }>Welcome to React

To get started, edit src/App.js and save to reload. diff --git a/test_app/app/js/index.js b/test_app/app/js/index.js index 8f6332c5..b4271100 100644 --- a/test_app/app/js/index.js +++ b/test_app/app/js/index.js @@ -21,7 +21,7 @@ import 'bootstrap/dist/css/bootstrap-theme.css'; import { Navbar, Jumbotron, Button } from 'react-bootstrap'; window.EmbarkJS = EmbarkJS; -window.SimpleStorage = SimpleStorage; +//window.SimpleStorage = SimpleStorage; window.Test = Test; window.Assert = Assert;