GithubHelp home page GithubHelp logo

mraible / angular-book Goto Github PK

View Code? Open in Web Editor NEW
6.0 6.0 6.0 122.75 MB

The Angular Mini-Book

Home Page: https://www.infoq.com/minibooks/angular-mini-book/

License: Apache License 2.0

Ruby 1.71% HTML 16.06% JavaScript 1.70% CSS 13.06% TypeScript 50.11% Kotlin 15.25% SCSS 1.70% Dockerfile 0.25% Handlebars 0.10% Procfile 0.06%
angular angular-material bootstrap kotlin oidc spring-boot typescript

angular-book's Introduction

Howdy, folks! ๐Ÿค 

Matt's YouTube Channel ย  Follow @mraible on Twitter ย  Matt on LinkedIn ย  Matt's Stack Overflow ย 

  • ๐Ÿ”ญ I'm currently working on finding my next gig. See my funemployment story and resume.
  • ๐Ÿ’ฌ Ask me about Java, Spring Boot, JHipster, Angular, or OAuth/OIDC.
  • ๐Ÿ˜„ Pronouns: He/him.
  • โšก Fun fact: I grew up without electricity or running water for 16 years.

Twitter follow @mraible ย  Linkedin follow @sivalabs ย  Blog

Languages and Tools

Matt's most used languages

My GitHub Stats

Matt's GitHub stats

angular-book's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

angular-book's Issues

Change `master` to `main` branch

Check out your `master` branch and create a new `netlify` one.

It might be necessary to show users how to set their default to main.

Investigate Knative warning

Running the following:

kubectl apply -f - <<EOF
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: pgdata
  annotations:
    volume.alpha.kubernetes.io/storage-class: default
spec:
  accessModes: [ReadWriteOnce]
  resources:
    requests:
      storage: 1Gi
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: postgres
spec:
  replicas: 1
  selector:
    matchLabels:
      service: postgres
  template:
    metadata:
      labels:
        service: postgres
    spec:
      containers:
        - name: postgres
          image: postgres:15.2
          ports:
            - containerPort: 5432
          env:
            - name: POSTGRES_DB
              value: bootiful-angular
            - name: POSTGRES_USER
              value: bootiful-angular
            - name: POSTGRES_PASSWORD
              value: $DB_PASSWORD
          volumeMounts:
            - mountPath: /var/lib/postgresql/data
              name: pgdata
              subPath: data
      volumes:
        - name: pgdata
          persistentVolumeClaim:
            claimName: pgdata
---
apiVersion: v1
kind: Service
metadata:
  name: pgservice
spec:
  ports:
  - port: 5432
    name: pgservice
  clusterIP: None
  selector:
    service: postgres
---
apiVersion: serving.knative.dev/v1
kind: Service
metadata:
  name: bootiful-angular
spec:
  template:
    spec:
      containers:
        - image: $DOCKER_USERNAME/bootiful-angular
          env:
          - name: SPRING_DATASOURCE_URL
            value: jdbc:postgresql://pgservice:5432/bootiful-angular
          - name: SPRING_DATASOURCE_USERNAME
            value: bootiful-angular
          - name: SPRING_DATASOURCE_PASSWORD
            value: $DB_PASSWORD
          - name: OKTA_OAUTH2_ISSUER
            value: $OKTA_ISSUER
          - name: OKTA_OAUTH2_CLIENT_ID
            value: $OKTA_CLIENT_ID
          - name: OKTA_OAUTH2_CLIENT_SECRET
            value: $OKTA_CLIENT_SECRET
          - name: OKTA_OAUTH2_AUDIENCE
            value: $OKTA_AUDIENCE
EOF

Results in the following, but still works.

Warning: Kubernetes default value is insecure, Knative may default this to secure in a future release: 
spec.template.spec.containers[0].securityContext.allowPrivilegeEscalation, 
spec.template.spec.containers[0].securityContext.capabilities, 
spec.template.spec.containers[0].securityContext.runAsNonRoot, 
spec.template.spec.containers[0].securityContext.seccompProfile

Confirm that `ng add @angular/localize` is necessary

Current text:

Add Bootstrap and NG Bootstrap:

[source,shell]
----
npm i bootstrap @ng-bootstrap/ng-bootstrap --force
----
// todo: add versions and remove force once ng-bootstrap supports Angular 12.
// https://github.com/ng-bootstrap/ng-bootstrap/issues/4093

Import `NgbModule` in `app.module.ts`:

[source,ts]
.src/app/app.module.ts
----
import { NgbModule } from '@ng-bootstrap/ng-bootstrap';

@NgModule({
  ...
  imports: [
    ...
    NgbModule
  ],
  ...
})
export class AppModule { }
----

If you run `ng serve -o`, you'll get a blank screen. Look in your browser's developer console, and you'll see why.

[source,shell]
----
Uncaught Error: It looks like your application or one of its dependencies is using i18n.
Angular 9 introduced a global `$localize()` function that needs to be loaded.
Please run `ng add @angular/localize` from the Angular CLI.
----

Cancel the process and run `ng add @angular/localize` to fix this error. Now, if you restart your app, you'll see it's pretty simple. And kinda ugly.

Fix tests after adding MockSecurityConfiguration

After adding this class, tests won't pass until you add a src/test/resources/application.properties with the following contents:

spring.main.allow-bean-definition-overriding=true
okta.oauth2.issuer=https://dev-06bzs1cu.us.auth0.com/
okta.oauth2.audience=api://default

Fix error that happens on startup

I'm unsure when this starts, but it should be fixed so users don't see a stack trace.

2023-04-11T09:02:04.416-06:00  INFO 50836 --- [           main] o.h.c.beanvalidation.TypeSafeActivator   : 
Error calling `jakarta.validation.Validation#buildDefaultValidatorFactory`

jakarta.validation.NoProviderFoundException: Unable to create a Configuration, because no 
Jakarta Bean Validation provider could be found. Add a provider like Hibernate Validator (RI) to your classpath.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.