TheUnreal
TheUnreal

Reputation: 24472

Using aframe with Angular 2

I'm trying to use Aframe in my angular 2 project.

I imported the library in my index.html but I still can't use the aframe directive, for example:

<a-scene>
    <a-box color="red"></a-box>
  </a-scene>

Throws the error:

Template parse errors:
'a-box' is not a known element:
1. If 'a-box' is an Angular component, then verify that it is part of this module.

How I can import such library to my angular 2 project and use it's directives?

Upvotes: 3

Views: 1576

Answers (2)

Hyperios
Hyperios

Reputation: 21

I fixed doing this:

I Try adding:

import {CUSTOM_ELEMENTS_SCHEMA} from '@angular/core';

to app.module.ts

then i add it to the NgModule Schemas:

@NgModule({ schemas: [ CUSTOM_ELEMENTS_SCHEMA ]})

that will fix it. Good luck!

Upvotes: 2

Will Graham
Will Graham

Reputation: 109

Try adding import {CUSTOM_ELEMENTS_SCHEMA} from '@angular/core'; to app.module.ts

Upvotes: 0

Related Questions