在我的项目中使用bootstrap和Angular JS Frameworks。我在模态中为文本框和其他东西分配了一些表达式。
ClickFunction(args)
{
$scope.firstname = args.FirstName
}
当我尝试在模态中分配值时,它不起作用。让'说
$scope.$apply.
ClickFunction(args)
{
$scope.firstname = args.FirstName;
$scope.$apply.
}
但是只有在我应用
时才会在bootstrap模态中显示该值func SendEmail(msg EmailMessage) {
ctx := context.Background()
b, err := ioutil.ReadFile("/tmp/client_secret.json")
if err != nil {
log.Fatalf("Unable to read client secret file: %v", err)
}
config, err := google.ConfigFromJSON(b, gmail.MailGoogleComScope)
if err != nil {
log.Fatalf("Unable to parse client secret file to config: %v", err)
}
client := getClient(ctx, config)
srv, err := gmail.New(client)
if err != nil {
log.Fatalf("Unable to retrieve gmail Client %v", err)
}
var message gmail.Message
temp := []byte("From: 'me'\r\n" +
"reply-to: sender@gmail.com\r\n" +
"To: " + msg.To + "\r\n" +
"Subject: " + msg.Subject + "\r\n" +
"\r\n" + msg.Body)
message.Raw = base64.StdEncoding.EncodeToString(temp)
message.Raw = strings.Replace(message.Raw, "/", "_", -1)
message.Raw = strings.Replace(message.Raw, "+", "-", -1)
message.Raw = strings.Replace(message.Raw, "=", "", -1)
imgFile, err := os.Open("image.png") // a QR code image
if err != nil {
log.Fatalf("Error in opening file")
}
defer imgFile.Close()
mediaOptions := googleapi.ContentType("message/rfc822")
_, err = srv.Users.Messages.Send("me", &message).Media(imgFile, mediaOptions).Do()
if err != nil {
log.Fatalf("Unable to send. %v", err)
}
}
我可以知道是什么原因吗?