我的navbar.component.ts
(click)=toggle(!isOn);
ison
会将true
的值更改为false
或welcome.component.ts
。
我有另一个组件navbar.component.ts
。我将Navbar
导入Navbar.isOn
。当我尝试记录undefined
时,它会显示Navbar
。当我记录function Navbar() {
this.selectedcity = 'Location';
this.isOn = false;
this.isDisabled = false;
}
时,它会给出
isOn
如何访问<div id="leftcol">
<div class="leftpadding">
<div class="logo_container">
<h1 class="logo"> <a href="/index.php" title="">
<span>
<img src="your_logo_url" alt="logo" />
</span>
</a> </h1>
</div>
<div class="moduletable">
</div>
</div>
的值。我想要做的是在用户点击按钮时隐藏身体溢出。
Angular 2 Version 2.0.0-beta.15
答案 0 :(得分:0)
注意:其他方式也有,但需要知道组合关系。
使用(截至目前)注射器,如下所示,
choice=menu()
while choice!='5':
num1=int(input("enter first number: "))
num2=int(input("enter the second number: "))
if choice=='1':
total= addTwoNumber(num1,num2)
print("sum of two numbers is: ",total)
conti=contin()
return
elif choice=='2':
sub=minTwoNumber(num1,num2)
print("num1-num2",sub)
conti=contin()
return
elif choice=='3':
quo,remain=qrTwoNumber(num1,num2)
print(quo)
print(remain)
conti=contin()
return
else:
print("Wrong Option.Kindly choose between 1 to 4 : ")
choice=menu()
def menu():
print("Welcome to the menu.Kindly choose from below: ")
print("1.To add two numbers: ")
print("2.To subtract two numbers: ")
print("3.For quotient and remainder :")
print("4.Exit Program")
opt=input("Enter number between 1-4")
if opt=='4':
print('Exiting program')
return opt
def addTwoNumber(n1,n2):
sum=n1+n2
return sum
def minTwoNumber(a1,a2):
minus=a1-a2
return minus
def qrTwoNumber(q1,q2):
quotient=q1//q2
remainder=q1%q2
return quotient,remainder
def contin():
con=input("Do you want to continue (Y/N):")
if con=='y' or con=='Y':
choice=menu()
else:
print("Exiting program")
sys.exit()
main()