Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- export class HeaderComponent implements OnInit {
- site_heading = "Business Casual";
- menubar = [];
- isLogged = true;
- constructor() {
- this.menubar = [{
- 'link': 'home',
- 'name': 'Home'
- }, {
- 'link': 'about',
- 'name': 'About'
- }, {
- 'link': 'store',
- 'name': 'Store'
- }, {
- 'link': 'products',
- 'name': 'Products'
- }];
- let userMenu = [{
- 'link': 'myprofile',
- 'name': 'My Profile'
- }, {
- 'link': 'logout',
- 'name': 'LogOut'
- }];
- userMenu.forEach(function(value) {
- this.menubar.push(value);
- });
- }
- ngOnInit() {}
- }
- ...
- userMenu.forEach((value) => {
- this.menubar.push(value);
- });
- ...
- userMenu.forEach((value) => {
- let self = this
- userMenu.forEach(function (value) {
- self.menubar.push(value);
- });
Add Comment
Please, Sign In to add comment