Code Monkey home page Code Monkey logo

angular2-bs4-navbar's Introduction

Angular2 Bootstrap4 Navbar

An Angular2 App with Bootstrap4 Navbar and routing using Angular2's New New Router v3.rc1. Navbar menu is fully configurable in TS files. Configuration is shared between Angular and Bootstrap Navbar

Update

Navbar is now responsive. Collapsible menu with Hamburger โ˜ฐ icon on Mobile AppModule(NgModule) and all featues are NgModule

DEMO

Steps to use

  1. Fork and clone this repository
  2. Run npm install
  3. Run npm run typings, to install all the typing files
  4. Run gulp to start watching html, scss and typescript changes and do a first build
  5. On new termial run npm start to start lite-server with live reload support

Angular2 Features

  1. Usage of NgModule and configure routes using RouterModule.forRoot([])
  2. Module specific routes using RouterModule.forChild([...])
  3. Code is based on Angular2 RC5
  4. Components and Child Components
  5. App Routing and Child Component Routing
  6. Usage of Router Directives and functions like routerLink and router.navigate
  7. Usage of Angular directives like ngClass, ngFor, ngStyle
  8. Responsive Navbar

Router and Navbar Configuration

Bootstrap Navbar are configured in app/navbar/navbar-routes.config.ts file eg.

		export const ROUTES: RouteInfo[] = [
			{ path: '', title: 'Angular2 Bootstrap4 Navbar', menuType: MenuType.BRAND },
			{ path: 'heroes', title: 'Heroes', menuType: MenuType.LEFT },
			{ path: 'about', title: 'About Us', menuType: MenuType.RIGHT },
			{ path: 'contact', title: 'Contact', menuType: MenuType.RIGHT }
		];
  • path is used set routerLink in Nav Item of Bootsrap
  • title is what is shown on Navbar for particular Nav Item
  • menuType can be LEFT, RIGHT and BRAND, based on this value the Menu Item is placed accordingly on the Navbar

TODO

  • Create AppModule and boot using bootstrapModule
  • Move hero component and children to NgModule
  • Add Content in DEMO pages
  • Render Nav based on config similar to dynamic-menu
    • Menu configuration should be controlled in TS file only
      • Get Menu and Route Configuration from HTTP instead of hardcoding
      • Active class for Active Routes
      • Support for Dropdown Menu
  • Move to SCSS
  • Image Compression
  • Tests

NOTE

  1. App runs on port 8002, configurable in bs-config.json under scripts
  2. lite-server uses browserSync and runs on port 3000, configurable in bs-config.json

Contributing

Create an issue on this repo if something is broken or if a feature is needed Feel Free to create a Pull Request if you fixed anything In case you want to add a feature, create an issue to disscuss the feature first

Copyright and license

The MIT License

Copyright (c) 2015-2016 Sirajuddin Choudhary

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

angular2-bs4-navbar's People

Contributors

mkwsra avatar sirajc avatar

Watchers

 avatar  avatar  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.