ProductPromotion
Logo

Angular.JS

made by https://0x3d.site

GitHub - sanity-io/sanity-template-angular-clean: A clean Angular SPA that gets content from Sanity
A clean Angular SPA that gets content from Sanity. Contribute to sanity-io/sanity-template-angular-clean development by creating an account on GitHub.
Visit Site

GitHub - sanity-io/sanity-template-angular-clean: A clean Angular SPA that gets content from Sanity

GitHub - sanity-io/sanity-template-angular-clean: A clean Angular SPA that gets content from Sanity

A minimal Angular SPA with Sanity Studio

This starter uses Angular for the front end and Sanity to handle its content.

Featuring

Note

This starter features an /app and a /studio folder. The /app folder contains the frontend code, and the /studio folder contains the Sanity Studio code.

This is not a monorepo setup. We put them both in one repository for the sake of simplicity. You might want to have separate repositories for each of the folders, to make it easier to deploy the app and the studio separately.

This example runs primarly as a Single Page Application and is not suitable for a performant production website. You can look into server- and pre-rendering Angular Universal apps if you plan to make it so.

Prerequisities

Getting started

The following instructions will take you in both the /app and /studio folders.

  1. npm install to install dependencies in both folders

  2. In the /studio folder, run npm create sanity@latest init --env (or use sanity init --env if you have the CLI installed). This will:

    • ask you to select or create a Sanity project and dataset
    • output a .env file with appropriate variables
  3. Copy your project ID and dataset name to the variables into /app/src/environments/environments.ts

  4. From the /studio folder, run npx sanity cors add http://localhost:4200 --no-credentials, to allow your app to request data from the browser (Go here to learn more about CORS)

  5. npm run dev to start the development servers in both folders

Your Angular app should now be running on http://localhost:4200/ and Studio on http://localhost:3333/.

Feel free to move each folder to its separate location and check them into version control.

Add content

  1. Visit the Studio and create and publish a new Post document
  2. Visit the App and refresh the page to see your content rendered on the page

The schema for the Post document is defined in the /studio/schemas folder. You can add more documents and schemas to the Studio to suit your needs.

Deployments

The /app and /studio folders are meant to be deployed separately.

Feel free to deploy the App to whichever hosting provider you prefer, like Vercel, Netlify, or Cloudflare Pages.

You can deploy the Sanity Studio by running sanity deploy in the /studio repository, provided you have the sanity package installed globally (npm install --global sanity). You can also run it with npx sanity deploy if you don't wish to install the CLI.

More Resources
to explore the angular.

mail [email protected] to add your project or resources here 🔥.

Related Articles
to learn about angular.

FAQ's
to learn more about Angular JS.

mail [email protected] to add more queries here 🔍.

More Sites
to check out once you're finished browsing here.

0x3d
https://www.0x3d.site/
0x3d is designed for aggregating information.
NodeJS
https://nodejs.0x3d.site/
NodeJS Online Directory
Cross Platform
https://cross-platform.0x3d.site/
Cross Platform Online Directory
Open Source
https://open-source.0x3d.site/
Open Source Online Directory
Analytics
https://analytics.0x3d.site/
Analytics Online Directory
JavaScript
https://javascript.0x3d.site/
JavaScript Online Directory
GoLang
https://golang.0x3d.site/
GoLang Online Directory
Python
https://python.0x3d.site/
Python Online Directory
Swift
https://swift.0x3d.site/
Swift Online Directory
Rust
https://rust.0x3d.site/
Rust Online Directory
Scala
https://scala.0x3d.site/
Scala Online Directory
Ruby
https://ruby.0x3d.site/
Ruby Online Directory
Clojure
https://clojure.0x3d.site/
Clojure Online Directory
Elixir
https://elixir.0x3d.site/
Elixir Online Directory
Elm
https://elm.0x3d.site/
Elm Online Directory
Lua
https://lua.0x3d.site/
Lua Online Directory
C Programming
https://c-programming.0x3d.site/
C Programming Online Directory
C++ Programming
https://cpp-programming.0x3d.site/
C++ Programming Online Directory
R Programming
https://r-programming.0x3d.site/
R Programming Online Directory
Perl
https://perl.0x3d.site/
Perl Online Directory
Java
https://java.0x3d.site/
Java Online Directory
Kotlin
https://kotlin.0x3d.site/
Kotlin Online Directory
PHP
https://php.0x3d.site/
PHP Online Directory
React JS
https://react.0x3d.site/
React JS Online Directory
Angular
https://angular.0x3d.site/
Angular JS Online Directory