DEV Community

Juraj Chovan
Juraj Chovan

Posted on

Pridanie servisu do Ionic aplikácie

V predchádzajúcom postupe som si vytvoril základnú kostru Ionic (ver.5) aplikácie. Ďalší postup ukazuje pridanie stránky do tejto Ionic aplikácie.
Teraz si vytvorím kostru servisu (ktorý bude neskôr obsluhovať autentifikáciu aplikácie).
Servis sa bude nazývať "auth". V adresári, kde mám vytvorenú túto Ionic aplikáciu spustiť príkaz:

ionic generate service services/auth
Enter fullscreen mode Exit fullscreen mode

Image description
Súbory servisu "auth" sú vytvorené v adresári "../services/auth":

Image description
Pri tejto príležitosti si ešte vytvorím jeden servis "env", kde budem uchovávať niektoré parametre potrebné pre túto Ionic aplikáciu.

ionic generate service services/env
Enter fullscreen mode Exit fullscreen mode

A len pre info - v IDE "Visual Studio Code" vidím teraz takúto štruktúru tohto projektu Ionic aplikácie:

Image description

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay