Closed ziacik closed 1 year ago
@ziacik sorry about the demo app. Tbh I haven't touched the angular demo for a while.
Now about your error in your app it seems to say it can't find the native android lib. I dont use nx so I can't tell. Can you try with in a template angular app? Again I am sorry I dont use angular but I know for certain other people are using it with angular.
@farfromrefug Thanks for the quick response. I tried this with nativescript original angular template, and it seems to work (altough at first I had an error saying I must set Material theme to styles.xml, so I did). So I guess I must figure out the differences with nx template. Thanks, closing.
@ziacik ok let me know if i can help. You can also find me in the discord of N
@farfromrefug Thanks. Can't use discord because the group seems to require a phone verification which I don't want.
Anyway, I figured this out, so if anyone got into this, here's the solution:
When using nx with the NS plugin, there are two package.json
-s generated, one in the root and another in the nativescript-***
app. In the second one, the reference to material ui component needs to be added too under dependencies, with *
as version (the same way as @nativescript/core). Then the platform stuff is generated correctly at build and everything works.
Make sure to check the demo app(s) for sample usage
I've tried the demo-ng. I wasn't able to get it work. Cloned this repo, did
yarn
, didnpm run build.all
(no error), thennpm run demo.ng.android
, got 22 compilation errors, such as:ERROR in ../demo-snippets/ng/tabs/tabs.component.ts:8:14 - error NG6007: The Component 'TabsComponent' is declared by more than one NgModule.
or even
SassError: Undefined variable. ╷ 2 │ font-family: $mdi-fontFamily;
Is it just not working, is it outdated, or am I doing something wrong? Maybe the README should be updated. I'd expect the demos to just work.
If the demo apps cannot help and there is no issue for your problem, tell us about it
So i wanted to use a component in my own app. The app is a nx workspace generated via nativescript-nx plugin. Installed using
tns plugin add @nativescript-community/ui-material-textfield
Imported the module and used in html.After start, I got
TypeError: Cannot read property 'material' of undefined
.Again - did I misconfigure something? If so, should be mentioned in the README.
Which platform(s) does your issue occur on?
Tried on Android.
Please, provide the following version numbers that your issue occurs with:
Is there any code involved?
git clone https://github.com/ziacik/amelie-ao3.git
cd amelie-ao3 && git checkout ui-material
npm i
npx nx android