|
@@ -48,7 +48,9 @@ npm install --save babylonjs-viewer
|
|
Afterwards it can be imported to the project using:
|
|
Afterwards it can be imported to the project using:
|
|
|
|
|
|
```javascript
|
|
```javascript
|
|
-import from 'babylonjs-viewer';
|
|
|
|
|
|
+import * as BabylonViewer from 'babylonjs-viewer';
|
|
|
|
+
|
|
|
|
+BabylonViewer.InitTags("my-tag");
|
|
```
|
|
```
|
|
|
|
|
|
This will enable the BabylonViewer namespace.
|
|
This will enable the BabylonViewer namespace.
|
|
@@ -57,13 +59,4 @@ Using webpack to package your project will use the minified js file.
|
|
|
|
|
|
## TypeScript
|
|
## TypeScript
|
|
|
|
|
|
-If you use the npm package, starting 3.2.0-alpha8 the babylon viewer has a module declaration file that also includes the BABYLON namespace.
|
|
|
|
-
|
|
|
|
-Using TypeScript and NPM you could do the following:
|
|
|
|
-
|
|
|
|
-```javascript
|
|
|
|
-import from 'babylonjs-viewer';
|
|
|
|
-
|
|
|
|
-// both namespaces are now available
|
|
|
|
-console.log(BabylonViewer, BABYLON)
|
|
|
|
-```
|
|
|
|
|
|
+If you use the npm package, starting 3.2.0-alpha8 the babylon viewer has a fully documented declaration file.
|