PeterStaev / NativeScript-Drop-Down

A NativeScript DropDown widget.
Apache License 2.0
105 stars 65 forks source link

Error Unable to load Dropdown in Playground App #197

Closed leenags closed 5 years ago

leenags commented 5 years ago

Hi,

I am new to nativescript Angular.I added the nativescript dropdown Plugin to my App .But when I run the app using Playground APP,I got the following Error

image

My Code is as follows Main.ts

// this import should be first in order to load some required settings (like globals and reflect-metadata) import { platformNativeScriptDynamic } from "nativescript-angular/platform";

import {registerElement} from "nativescript-angular/element-registry"; registerElement("DropDown", () => require("nativescript-drop-down/drop-down").DropDown);

import { AppModule } from "./app/app.module"; //import { DropDownModule } from "nativescript-drop-down/angular";

// A traditional NativeScript application starts by initializing global objects, setting up global CSS rules, creating, and navigating to the main page. // Angular applications need to take care of their own initialization: modules, components, directives, routes, DI providers. // A NativeScript Angular app needs to make both paradigms work together, so we provide a wrapper platform object, platformNativeScriptDynamic, // that sets up a NativeScript application and can bootstrap the Angular framework. platformNativeScriptDynamic().bootstrapModule(AppModule);

AppModule.ts

import { DropDownModule } from "nativescript-drop-down/angular";

In AppComponent.ts

import {DropDown} from "nativescript-drop-down"

Versions

"nativescript-angular": "~7.1.0", "nativescript-drop-down": "^4.0.1", "tns-core-modules": "~5.1.0",

Any help will be really appreciated

Thanks, Leena S

PeterStaev commented 5 years ago

Hey @leenags , it is really hard to say what is wrong. What i notice in your code is that you have commented out the import of the drop down module and you are manually registering it.

Please make sure you read the documentation in the Readme and also take a look at the demo project in the demo-ng folder of this report. They should get you enough info to get you started.

leenags commented 5 years ago

I downloaded the demo code and tried running the demo-ng App .I am getting same error .

PeterStaev commented 5 years ago

Then there must be something wrong with your set up. I just tried the demo-ng app and it works ok.

Another thing to try is to use tns run instead of tns preview.

PeterStaev commented 5 years ago

No further response so closing this one for now. In case you still have problems, please provide more details.