Giter Site home page Giter Site logo

splaktar / angularjs-angular-material-hybrid-demo Goto Github PK

View Code? Open in Web Editor NEW
15.0 1.0 5.0 1.33 MB

Demo of AngularJS/Angular Material running in hybrid mode in the Angular CLI

Home Page: https://material-hybrid.web.app

License: MIT License

HTML 35.30% TypeScript 52.70% JavaScript 1.09% SCSS 10.91%
angularjs-material angular-material angular-cdk ngupgrade angular angularjs

angularjs-angular-material-hybrid-demo's Introduction

AngularJS/Angular Material Hybrid Demo

This was started on StackBlitz, based on a demo by George Kalpakas, but using Angular Upgrade can be done in a way that is either compatible with StackBlitz or the Angular CLI, not both. This repo uses the Angular CLI along with the downgradeModule().

Find out more in the Upgrading for Performance Guide.

AngularJS Material Migration Guide

We recently published a comprehensive guide for upgrading AngularJS Material apps to Angular. It includes guidance for migrating to Angular Material, the Angular Component Dev Kit (CDK), and the Angular Flex Layout library. Additionally, we provide guidance on using pure CSS Grid and Flexbox for application layout, migration of theming features, services, typography, and more.

Learn more in the AngularJS Material Migration Guide.

Caveats found so far

  • Different selector formatting and conversions between AngularJS and Angular. It depends on which framework refers to the component, not which framework compiled the component.
    • AngularJS referring to any component: appComponent
    • Angular referring to any component: app-component
  • ngUpgrade projects that work on StackBlitz, don’t work in the CLI and vice versa.

Minification-friendly AngularJS Code

  • Enable strictDi to help you catch issues early:
    • angular.bootstrap(rootElement, [appAngularjsModule.name], { strictDi: true });
    • Example
  • For injections into .run(), .config(), etc. You can use either of:
    • Inline Function Annotation:
      • .run([ '$templateCache', ($templateCache) => {
      • Example
    • $inject Annotation
      • configFunction.$inject = ['$mdThemingProvider', '$mdGestureProvider'];
      • Example
  • For TypeScript classes use $inject Annotation:
    • static $inject = ['$scope'];
    • Example

AngularJS Components w/ templateUrl

templateUrl in AngularJS components does not work out of the box with Angular CLI. The following steps will configure a module that loads $templateCache at build time:

If you are working on AngularJS Templates (.html files referenced via templateUrl), and you want to enable the Angular CLI to auto-reload on changes, run:

npm run watch:templates

TODO

  • Add some AngularJS Material services.
  • Add some Angular Material services.
  • Add some CDK services.
  • Set up a watcher to rebuild AngularJS $templateCache
  • Customize the AngularJS Material theme.
  • Customize the Angular Material theme.
  • Add more AngularJS Material components.
  • Add more Angular Material components.
  • Add more CDK components.
  • Work around Terser mangling, using dependency annotation.
  • Look into loading $templateCache at build time, using Gulp.

angularjs-angular-material-hybrid-demo's People

Contributors

dependabot[bot] avatar snyk-bot avatar splaktar avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

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.