Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

internal variable #1585

Open
augiaugi opened this issue Mar 30, 2020 · 3 comments
Open

internal variable #1585

augiaugi opened this issue Mar 30, 2020 · 3 comments
Labels
bug Something isn't working

Comments

@augiaugi
Copy link
Contributor

augiaugi commented Mar 30, 2020

Describe the Issue

I came across that my components are getting $null value from the parameter I pass to the functions.

function New-AppBar 
{
    param
    (
        [string]$Titel
    )

    New-UDHelmet -Content {
        New-UDHtmlTag -Tag 'title' -Content { 
            $Titel
        }
    }
    
    $Drawer = New-UDDrawer -Children {
        New-UDList -Children {
            ...
        }
    }
    
    New-UDAppbar -Children {
        New-UDElement -Tag 'div' -Content { 
            $Titel
        }
    } -Drawer $Drawer
}

New-AppBar -Titel 'ObjectType'

I figured out that after changing the property from -Titel to -Text anything worked as expected.
Title is an internal property of UD or one of the component and this can be the reason that my variable was $null.

A error message would have saved me a lot of time and I think this is not the only example that can happen.

Version Information

  • Operating System: Win10
  • PowerShell Version: 5.1.17763.1007
  • Universal Dashboard Version: v3.0.0-beta1
  • UD Hosting Method: Powershell
@augiaugi augiaugi added the bug Something isn't working label Mar 30, 2020
@augiaugi
Copy link
Contributor Author

augiaugi commented Apr 3, 2020

@adamdriscoll

Is this change resolving my issue?

1e3e13a

@adamdriscoll
Copy link
Member

I don't think so. It's just preventing variables like $error from being overwritten. I don't see anywhere in UD where we are setting a variable -Titel

@augiaugi
Copy link
Contributor Author

augiaugi commented Apr 3, 2020

@adamdriscoll

Can you reproduce the issue too?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants