GithubHelp home page GithubHelp logo

irtyamine / ui5-webcomponents-sample-angular Goto Github PK

View Code? Open in Web Editor NEW

This project forked from sap-samples/ui5-webcomponents-sample-angular

0.0 0.0 0.0 5.08 MB

UI5 Web Components Sample TODO application built with Angular.

Home Page: https://sap-samples.github.io/ui5-webcomponents-sample-angular/

License: Apache License 2.0

Shell 0.22% JavaScript 73.29% TypeScript 1.04% CSS 25.22% HTML 0.23%

ui5-webcomponents-sample-angular's Introduction

UI5 logo

UI5 Web Components Angular Sample Application

Angular sample application to demonstrate the usage of the UI5 Web Components. It shows how to bind properties, to subscribe to events, using nested components and the bootstrapped Angular build.

This project was bootstrapped with Angular CLI.

Prerequisites

  • Node.js (version 8.5 or higher โš ๏ธ)

Getting started

  1. Clone this repository using the GitHub Command line tool and navigate into the downloaded directory.

    git clone https://github.com/SAP/ui5-webcomponents-sample-angular.git
    cd ui5-webcomponents-sample-angular
  2. Install all dependencies

    npm install
  3. Start a local server and run the application. (The running application can be found here: http://localhost:4200)

    npm start

Browser support

Currently only Chrome, Safari and Firefox support Web Components natively.

If your application should run on browsers without native Web Components support (Edge and/or IE11), import one the following modules before your first Web Component import:

Edge only

import "@ui5/webcomponents-base/dist/features/browsersupport/Edge";

Edge and IE11

import "@ui5/webcomponents-base/dist/features/browsersupport/IE11";

Note: Importing the module for IE11 support automatically enables Edge support as well, so there is no need to import them both explicitly.

Example:

import "@ui5/webcomponents-base/dist/features/browsersupport/IE11"; // This will enable Edge and IE11 support for all Web Components below
import "@ui5/webcomponents/dist/Button"; // loads ui5-button
import "@ui5/webcomponents/dist/Label"; // loads ui5-label

Noteworthy

Consume UI5 Web Components

Import the desired component(s) in your app to define the UI5 Web Component.

For example, to use ui5-button you need to import it:

import "@ui5/webcomponents/dist/Button"; // loads ui5-button

Then, you can use the custom element in an HTML page:

<ui5-button>Hello world!</ui5-button>

Configure events

A custom configuration for UI5 Web Components should be provided in the html:

<script data-id="sap-ui-config" type="application/json">
  {
    "xx-wc-no-conflict": {
      "events": "press"
    }
  }
</script>

Than press event for ui5-button, ui5-togglebutton, ui5-icon and ui5-link should be attached with (ui5-click) instead of (click)

Configure Angular Build

When UI5 Web Components are used they include all of their translation files and CLDR data files in the application bundle. In order to decrease the bundle size of the application a custom Webpack configuration should be provided.

You can follow the steps described by this article.

The content of the webpack.partial.js file should be:

webpack.partial.js

module.exports = {
    module: {
      rules: [
        {
          test: [/cldr\/.*\.json$/, /i18n\/.*\.json$/],
          loader: 'file-loader',
          options: {
            name: 'static/media/[name].[hash:8].[ext]',
          },
          type: 'javascript/auto'
        }
      ]
    }
};

Where is the npm package?

Limitations

No limitations known.

Known Issues

No major bugs known.

Support

We welcome all comments, suggestions, questions, and bug reports. Please follow our Support Guidelines on how to report an issue, or chat with us in the #webcomponents channel of the OpenUI5 Community Slack.

Contribute to UI5 Web Components

Please check our Contribution Guidelines.

License

Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, Version 2.0 except as noted otherwise in the LICENSE file.

ui5-webcomponents-sample-angular's People

Contributors

ilhan007 avatar adrian-bobev avatar fifoosid avatar mapto0 avatar vladitasev avatar dependabot[bot] 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.